From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757252AbdDROHK (ORCPT ); Tue, 18 Apr 2017 10:07:10 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:53848 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752847AbdDROHI (ORCPT ); Tue, 18 Apr 2017 10:07:08 -0400 From: Colin King To: "David S . Miller" , Alexey Kuznetsov , James Morris , Hideaki YOSHIFUJI , Patrick McHardy , netdev@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][net-next] esp6: fix incorrect null pointer check on xo Date: Tue, 18 Apr 2017 15:06:53 +0100 Message-Id: <20170418140653.8839-1-colin.king@canonical.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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") Signed-off-by: Colin Ian King --- net/ipv6/esp6_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.11.0