Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lkdtm: cfi: use NULL for a null pointer rather than zero

There is a pointer being initialized with a zero, use NULL instead.

Cleans up sparse warning:
drivers/misc/lkdtm/cfi.c:100:27: warning: Using plain integer as NULL pointer

Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20220612202708.2754270-1-colin.i.king@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Colin Ian King and committed by
Greg Kroah-Hartman
5afbfa8c 6169525b

+1 -1
+1 -1
drivers/misc/lkdtm/cfi.c
··· 97 97 static void lkdtm_CFI_BACKWARD(void) 98 98 { 99 99 /* Use calculated gotos to keep labels addressable. */ 100 - void *labels[] = {0, &&normal, &&redirected, &&check_normal, &&check_redirected}; 100 + void *labels[] = { NULL, &&normal, &&redirected, &&check_normal, &&check_redirected }; 101 101 102 102 pr_info("Attempting unchecked stack return address redirection ...\n"); 103 103