bpf: btf: fix inconsistent IS_ERR and PTR_ERR
Subsystems (4)
PATCH 1/1 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.
--- tools/bpf/bpftool/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/map.c +1 -1
@@ -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 ; }
Signature · 1 line
2.7.0
From: YueHaibing <[email protected]>
Date: Tue, 24 Jul 2018 10:55:24 +0800
Quoted 7 lines
Fix inconsistent
IS_ERRandPTR_ERRinget_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]>
Quoted 7 lines · YueHaibing
Fix inconsistent
IS_ERRandPTR_ERRinget_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]>
FWIW:
Thanks!
Quoted 7 lines · YueHaibing
Fix inconsistent
IS_ERRandPTR_ERRinget_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]>
Quoted 21 lines
--- tools/bpf/bpftool/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/bpf/bpftool/map.c +1
-1@@ -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 ; }Signature · 1 line
2.7.0
Quoted 7 lines · YueHaibing
Fix inconsistent
IS_ERRandPTR_ERRinget_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]>
Applied to bpf-next, thanks Yue!