Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1784065imm; Thu, 20 Sep 2018 02:51:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbbxOfb78FXqAD4annDtr/3kFzlvEVZxInr1Jwc+mSQFaU4x3mlfGOP0LG+JQRClAkwUEWP X-Received: by 2002:a63:69c3:: with SMTP id e186-v6mr35121846pgc.431.1537437114519; Thu, 20 Sep 2018 02:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537437114; cv=none; d=google.com; s=arc-20160816; b=WmysFQWAJfUvWFIxssxhdOKBRj6ObK3GwugE06JIQQMXzgnarY8WEN36PPP4gZprE9 f176QwvbmrZKj70CV0mcCOPQFoz44ep3YyAwXTu66E30zfLS/EB50IxoXlrXp8pwRaZF Hu0tcIAlt+BVEix4p38pGfbYq/EHwdkkYd781dHWYsF00sGopntrq8809QOPZLtfgdU9 FSAtSA8o7+4IA4pmsO9TgVTbp+O5kjBg81O37glGP2U1R/hKVbloRZikHnNH33x/3cVW rX0S/HfCaw245Wg+4+vUdp3QfT4luDh6OcfWTc5eSyIy1G8Kbz4oNWKzkKLAtTVGOA08 MySw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=fiAqYsdywuNYRAqaQecH6WAUcKuRuiH8bHVWtBG44eU=; b=d9MLGsuZbjjgtMZTzXPXMZn1vpGNJY5uI4cXEjHHJSbXgIeN8SMDDG59EoQyCK7Uf4 jmHRbTiUKq+4soM3jPq6f4lCLgiHUYZFV6O+oUapb6NNnXhIpW4Rn+QJfteBMC/T+wur wF76gSSPR0o9q8wKGoXOwpvXCUACy9W8L4bcURu0dATP7U0MPi/dUbGm7lvLrVWXEC9k TBVZvyaOJtTKeG+a3FUl3xX0+RwkUiX5ob4BKD+TI+28xSu18HjCXhFILU9Bjh4hheWW 46iSMEUx0ZESOwWzdBfAbnatroiks8TshVYyE8Ue49PdHp4qRvf37B8oXwjONHeKaUaj /baQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32-v6si23728653pld.330.2018.09.20.02.51.39; Thu, 20 Sep 2018 02:51:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732304AbeITPcy (ORCPT + 99 others); Thu, 20 Sep 2018 11:32:54 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12633 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727633AbeITPcx (ORCPT ); Thu, 20 Sep 2018 11:32:53 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id A8941EA16A8D6; Thu, 20 Sep 2018 17:50:12 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.399.0; Thu, 20 Sep 2018 17:50:12 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH 5/6] net: cxgb3_main: remove redundant null pointer check before kfree_skb Date: Thu, 20 Sep 2018 17:37:45 +0800 Message-ID: <1537436266-41955-6-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com> References: <1537436266-41955-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org kfree_skb has taken the null pointer into account. hence it is safe to remove the redundant null pointer check before kfree_skb. Signed-off-by: zhong jiang --- drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c index a19172d..680c6fe 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c @@ -3423,8 +3423,7 @@ static void remove_one(struct pci_dev *pdev) free_netdev(adapter->port[i]); iounmap(adapter->regs); - if (adapter->nofail_skb) - kfree_skb(adapter->nofail_skb); + kfree_skb(adapter->nofail_skb); kfree(adapter); pci_release_regions(pdev); pci_disable_device(pdev); -- 1.7.12.4