[PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [tooling] (bpftool), the rest

STALE2966d

5 messages, 5 authors, 2018-07-25 · open the first message on its own page

[PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR

From: YueHaibing <hidden>
Date: 2018-07-24 02:56:22

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 <redacted>
---
 tools/bpf/bpftool/map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index 9c81918..0ee3ba4 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -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;
 	}
 
-- 
2.7.0

Re: [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR

From: David Miller <davem@davemloft.net>
Date: 2018-07-24 03:20:44

From: YueHaibing <redacted>
Date: Tue, 24 Jul 2018 10:55:24 +0800
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 <redacted>
Acked-by: David S. Miller <davem@davemloft.net>

Re: [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR

From: Jakub Kicinski <hidden>
Date: 2018-07-24 03:40:27

On Tue, 24 Jul 2018 10:55:24 +0800, YueHaibing wrote:
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 <redacted>
FWIW:

Acked-by: Jakub Kicinski <redacted>

Thanks!

Re: [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR

From: Martin KaFai Lau <hidden>
Date: 2018-07-24 15:46:40

On Tue, Jul 24, 2018 at 10:55:24AM +0800, YueHaibing wrote:
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 <redacted>
Acked-by: Martin KaFai Lau <redacted>
quoted hunk
---
 tools/bpf/bpftool/map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index 9c81918..0ee3ba4 100644
--- a/tools/bpf/bpftool/map.c
+++ b/tools/bpf/bpftool/map.c
@@ -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;
 	}
 
-- 
2.7.0

Re: [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2018-07-25 05:46:04

On 07/24/2018 04:55 AM, YueHaibing wrote:
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 <redacted>
Applied to bpf-next, thanks Yue!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help