netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR
@ 2018-07-24  2:55 YueHaibing
  2018-07-24  3:20 ` David Miller
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: YueHaibing @ 2018-07-24  2:55 UTC (permalink / raw)
  To: ast, daniel, quentin.monnet, jakub.kicinski, bhole_prashant_q7, osk
  Cc: linux-kernel, netdev, davem, YueHaibing

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>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR
  2018-07-24  2:55 [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR YueHaibing
@ 2018-07-24  3:20 ` David Miller
  2018-07-24  3:40 ` Jakub Kicinski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2018-07-24  3:20 UTC (permalink / raw)
  To: yuehaibing
  Cc: ast, daniel, quentin.monnet, jakub.kicinski, bhole_prashant_q7,
	osk, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
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 <yuehaibing@huawei.com>

Acked-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR
  2018-07-24  2:55 [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR YueHaibing
  2018-07-24  3:20 ` David Miller
@ 2018-07-24  3:40 ` Jakub Kicinski
  2018-07-24 15:45 ` Martin KaFai Lau
  2018-07-25  5:45 ` Daniel Borkmann
  3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2018-07-24  3:40 UTC (permalink / raw)
  To: YueHaibing
  Cc: ast, daniel, quentin.monnet, bhole_prashant_q7, osk,
	linux-kernel, netdev, davem

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 <yuehaibing@huawei.com>

FWIW:

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR
  2018-07-24  2:55 [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR YueHaibing
  2018-07-24  3:20 ` David Miller
  2018-07-24  3:40 ` Jakub Kicinski
@ 2018-07-24 15:45 ` Martin KaFai Lau
  2018-07-25  5:45 ` Daniel Borkmann
  3 siblings, 0 replies; 5+ messages in thread
From: Martin KaFai Lau @ 2018-07-24 15:45 UTC (permalink / raw)
  To: YueHaibing
  Cc: ast, daniel, quentin.monnet, jakub.kicinski, bhole_prashant_q7,
	osk, linux-kernel, netdev, davem

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 <yuehaibing@huawei.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>

> ---
>  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
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR
  2018-07-24  2:55 [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR YueHaibing
                   ` (2 preceding siblings ...)
  2018-07-24 15:45 ` Martin KaFai Lau
@ 2018-07-25  5:45 ` Daniel Borkmann
  3 siblings, 0 replies; 5+ messages in thread
From: Daniel Borkmann @ 2018-07-25  5:45 UTC (permalink / raw)
  To: YueHaibing, ast, quentin.monnet, jakub.kicinski, bhole_prashant_q7, osk
  Cc: linux-kernel, netdev, davem

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 <yuehaibing@huawei.com>

Applied to bpf-next, thanks Yue!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-25  5:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-24  2:55 [PATCH bpf-next] bpf: btf: fix inconsistent IS_ERR and PTR_ERR YueHaibing
2018-07-24  3:20 ` David Miller
2018-07-24  3:40 ` Jakub Kicinski
2018-07-24 15:45 ` Martin KaFai Lau
2018-07-25  5:45 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).