public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment()
@ 2018-03-28 11:48 Dan Carpenter
  2018-03-28 13:25 ` Daniel Borkmann
  2018-03-28 16:19 ` Yonghong Song
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2018-03-28 11:48 UTC (permalink / raw)
  To: Alexei Starovoitov, Yonghong Song
  Cc: Daniel Borkmann, netdev, kernel-janitors

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 <dan.carpenter@oracle.com>

diff --git a/lib/test_bpf.c b/lib/test_bpf.c
index b2badf6b23cd..8e157806df7a 100644
--- a/lib/test_bpf.c
+++ b/lib/test_bpf.c
@@ -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__);

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

end of thread, other threads:[~2018-03-29 18:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-28 11:48 [PATCH] test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment() Dan Carpenter
2018-03-28 13:25 ` Daniel Borkmann
2018-03-28 16:19 ` Yonghong Song
2018-03-28 18:57   ` Daniel Borkmann
2018-03-29 18:33     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox