Skip to content

Commit

Permalink
bpf: Fix warning comparing pointer to 0
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jiapeng Chong <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/1615360714-30381-1-git-send-email-jiapeng.chong@linux.alibaba.com
  • Loading branch information
Jiapeng Chong authored and anakryiko committed Mar 10, 2021
1 parent 04ea63e commit a9c80b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/progs/fentry_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ __u64 test7_result = 0;
SEC("fentry/bpf_fentry_test7")
int BPF_PROG(test7, struct bpf_fentry_test_t *arg)
{
if (arg == 0)
if (!arg)
test7_result = 1;
return 0;
}
Expand Down

0 comments on commit a9c80b0

Please sign in to comment.