bpf: btf: fix inconsistent IS_ERR and PTR_ERR
authorYueHaibing <[email protected]>
Tue, 24 Jul 2018 02:55:24 +0000 (10:55 +0800)
committerDaniel Borkmann <[email protected]>
Wed, 25 Jul 2018 05:43:31 +0000 (07:43 +0200)
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 <[email protected]>
Acked-by: David S. Miller <[email protected]>
Acked-by: Jakub Kicinski <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
tools/bpf/bpftool/map.c

index 9c81918455850c411eea9306fdd189a55a89fa6e..0ee3ba479d877add95b5bfdd457e561ffc6d45d0 100644 (file)
@@ -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);
        if (IS_ERR(*btf)) {
-               err = PTR_ERR(btf);
+               err = PTR_ERR(*btf);
                *btf = NULL;
        }