Commit 99fe29d3 authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

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: 76db8087 ("net: bpf: add a test for skb_segment in test_bpf module")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Reviewed-by: default avatarYonghong Song <yhs@fb.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 981f1f80
...@@ -6649,7 +6649,7 @@ static __init int test_skb_segment(void) ...@@ -6649,7 +6649,7 @@ static __init int test_skb_segment(void)
} }
segs = skb_segment(skb, features); segs = skb_segment(skb, features);
if (segs) { if (!IS_ERR(segs)) {
kfree_skb_list(segs); kfree_skb_list(segs);
ret = 0; ret = 0;
pr_info("%s: success in skb_segment!", __func__); pr_info("%s: success in skb_segment!", __func__);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment