test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment()
Subsystems (4)
PATCH 1/1 test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment()
The skb_segment() function returns error pointers on error. It never returns NULL.
lib/test_bpf.c +1 -1
@@ -6649,7 +6649,7 @@ static __init int test_skb_segment(void) } segs =skb_segment (skb, features); -if (segs) { +if (!IS_ERR (segs)) {kfree_skb_list (segs); ret =0 ;pr_info ("%s: success in skb_segment!" , __func__);
Quoted 5 lines · Dan Carpenter
The
skb_segment()function returns error pointers on error. It never returns NULL.Fixes 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module")Signed-off-by Dan Carpenter <[email protected]>
Patch is directly for net-next, thanks!
Quoted 11 lines · Dan Carpenter
The
skb_segment()function returns error pointers on error. It never returns NULL.Fixes 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module")Signed-off-by Dan Carpenter <[email protected]>lib/test_bpf.c +0
-0
lib/test_bpf.c static __init int test_skb_segment(void) · line 6655
Quoted 8 lines
lib/test_bpf.c +1
-1@@ -6649,7 +6649,7 @@ static __init int test_skb_segment(void) } segs =skb_segment (skb, features); -if (segs) { +if (!IS_ERR (segs)) {kfree_skb_list (segs); ret =0 ;pr_info ("%s: success in skb_segment!" , __func__);
Oh, my bad. Thanks for the fix!
Hi David,
Quoted 21 lines · Yonghong Song
Quoted 11 lines · Dan Carpenter
The
skb_segment()function returns error pointers on error. It never returns NULL.Fixes 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module")Signed-off-by Dan Carpenter <[email protected]>lib/test_bpf.c +0
-0lib/test_bpf.c static __init int test_skb_segment(void) · line 6654
Quoted 7 lines
lib/test_bpf.c +1
-1@@ -6649,7 +6649,7 @@ static __init int test_skb_segment(void) } segs = skb_segment(skb, features); - if (segs) { + if (!IS_ERR(segs)) { kfree_skb_list(segs); ret = 0; pr_info("%s: success in skb_segment!", __func__);Oh, my bad. Thanks for the fix!
Quoted 1 line
Reviewed-by Yonghong Song <[email protected]>
If you have a chance, please take this fix directly into your net-next tree since it also contains the original commit 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module"), which is not in the bpf-next tree at this point.
Thanks a lot,
Daniel
David Miller
maintainerFrom: Daniel Borkmann <[email protected]>
Date: Wed, 28 Mar 2018 20:57:27 +0200
Quoted 4 lines
If you have a chance, please take this fix directly into your net-next tree since it also contains the original commit
76db8087c4c9("net: bpf: add a test forskb_segmentintest_bpfmodule"), which is not in the bpf-next tree at this point.
Ok, done.