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: 76db8087c4 ("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>
This commit is contained in:
Dan Carpenter 2018-03-28 14:48:36 +03:00 committed by David S. Miller
parent 981f1f8035
commit 99fe29d3a2

View file

@ -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__);