Skip to content

Commit

Permalink
test_bpf: Fix NULL vs IS_ERR() check in test_skb_segment()
Browse files Browse the repository at this point in the history
The skb_segment() function returns error pointers on error.  It never
returns NULL.

Fixes: 76db808 ("net: bpf: add a test for skb_segment in test_bpf module")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Reviewed-by: Yonghong Song <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Mar 29, 2018
1 parent 981f1f8 commit 99fe29d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/test_bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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__);
Expand Down

0 comments on commit 99fe29d

Please sign in to comment.