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

bpf: btf: fix inconsistent IS_ERR and PTR_ERR

Fix inconsistent IS_ERR and PTR_ERR in get_btf,
the proper pointer to be passed as argument is '*btf'

This issue was detected with the help of Coccinelle.

Fixes: 2d3feca8c44f ("bpf: btf: print map dump and lookup with btf info")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>

authored by

YueHaibing and committed by
Daniel Borkmann
2cc512c1 aea5f654

+1 -1
+1 -1
tools/bpf/bpftool/map.c
··· 230 230 231 231 *btf = btf__new((__u8 *)btf_info.btf, btf_info.btf_size, NULL); 232 232 if (IS_ERR(*btf)) { 233 - err = PTR_ERR(btf); 233 + err = PTR_ERR(*btf); 234 234 *btf = NULL; 235 235 } 236 236