]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
esp6: fix incorrect null pointer check on xo
authorColin Ian King <colin.king@canonical.com>
Tue, 18 Apr 2017 14:06:53 +0000 (15:06 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 19 Apr 2017 04:49:00 +0000 (06:49 +0200)
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 <colin.king@canonical.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/ipv6/esp6_offload.c

index 1cceeee7cc33b0e5048dcd3214b71b66f352ac6c..95f10728abaaa84dd3f031e1bbf023dd05922d31 100644 (file)
@@ -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;