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

bpf: Fix warning comparing pointer to 0

Fix the following coccicheck warning:

./tools/testing/selftests/bpf/progs/fentry_test.c:67:12-13: WARNING
comparing pointer to 0.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/1615360714-30381-1-git-send-email-jiapeng.chong@linux.alibaba.com

authored by

Jiapeng Chong and committed by
Andrii Nakryiko
a9c80b03 04ea63e3

+1 -1
+1 -1
tools/testing/selftests/bpf/progs/fentry_test.c
··· 64 64 SEC("fentry/bpf_fentry_test7") 65 65 int BPF_PROG(test7, struct bpf_fentry_test_t *arg) 66 66 { 67 - if (arg == 0) 67 + if (!arg) 68 68 test7_result = 1; 69 69 return 0; 70 70 }