提交 2cc512c1 编写于 作者: Y YueHaibing 提交者: Daniel Borkmann

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: 2d3feca8 ("bpf: btf: print map dump and lookup with btf info")
Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: NMartin KaFai Lau <kafai@fb.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
上级 aea5f654
...@@ -230,7 +230,7 @@ static int get_btf(struct bpf_map_info *map_info, struct btf **btf) ...@@ -230,7 +230,7 @@ static int get_btf(struct bpf_map_info *map_info, struct btf **btf)
*btf = btf__new((__u8 *)btf_info.btf, btf_info.btf_size, NULL); *btf = btf__new((__u8 *)btf_info.btf, btf_info.btf_size, NULL);
if (IS_ERR(*btf)) { if (IS_ERR(*btf)) {
err = PTR_ERR(btf); err = PTR_ERR(*btf);
*btf = NULL; *btf = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册