From: Dan Carpenter Date: Wed, 28 Mar 2018 11:48:36 +0000 (+0300) Subject: test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=99fe29d3a25f813146816b322367b4c6a0fdec84;p=openwrt%2Fstaging%2Fblogic.git 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. Fixes: 76db8087c4c9 ("net: bpf: add a test for skb_segment in test_bpf module") Signed-off-by: Dan Carpenter Acked-by: Daniel Borkmann Reviewed-by: Yonghong Song Signed-off-by: David S. Miller --- 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__);