kernel: fix sanity check