summaryrefslogtreecommitdiffstats
path: root/lib/test_bpf.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-03-28 14:48:36 +0300
committerDavid S. Miller <davem@davemloft.net>2018-03-29 14:33:29 -0400
commit99fe29d3a25f813146816b322367b4c6a0fdec84 (patch)
tree8197459068121adbb98ea603bb421d922f1f4927 /lib/test_bpf.c
parent981f1f803516666d3e02f1d707a7f4b0ebf41967 (diff)
downloadlinux-99fe29d3a25f813146816b322367b4c6a0fdec84.tar.gz
linux-99fe29d3a25f813146816b322367b4c6a0fdec84.tar.bz2
linux-99fe29d3a25f813146816b322367b4c6a0fdec84.zip
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 <dan.carpenter@oracle.com> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Yonghong Song <yhs@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/test_bpf.c')
-rw-r--r--lib/test_bpf.c2
1 files changed, 1 insertions, 1 deletions
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__);