From ffa6f571e4e20bbe5b3d8b5e112e66b3b6c29632 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Tue, 18 Apr 2017 15:06:53 +0100 Subject: esp6: fix incorrect null pointer check on xo The check for xo being null is incorrect, currently it is checking for non-null, it should be checking for null. Detected with CoverityScan, CID#1429349 ("Dereference after null check") Fixes: 7862b4058b9f ("esp: Add gso handlers for esp4 and esp6") Signed-off-by: Colin Ian King Signed-off-by: Steffen Klassert --- net/ipv6/esp6_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net/ipv6/esp6_offload.c') diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c index 1cceeee7cc33..95f10728abaa 100644 --- a/net/ipv6/esp6_offload.c +++ b/net/ipv6/esp6_offload.c @@ -120,7 +120,7 @@ static struct sk_buff *esp6_gso_segment(struct sk_buff *skb, netdev_features_t esp_features = features; struct xfrm_offload *xo = xfrm_offload(skb); - if (xo) + if (!xo) goto out; seq = xo->seq.low; -- cgit v1.2.3