Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1783738imm; Thu, 20 Sep 2018 02:51:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaQnqvVTDIl3I02LujHR9AoHTFjTUUUElmNccoqUGXtIaP7TUBH0Arhd6fc86sh7Ti9AwFA X-Received: by 2002:a63:41c2:: with SMTP id o185-v6mr5269431pga.11.1537437090294; Thu, 20 Sep 2018 02:51:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537437090; cv=none; d=google.com; s=arc-20160816; b=Y5if+wj1RnV+IJTFL0Xe+juDPKZN5fRobf1ctT+2/QhAgzZHoDHGfgPdMRMXbHSQIA YK/toU3tDXgyBU3OI4lNqLtFXu2Rahxc2EGi9QlArQnItm27uTLS/XCWjpjPSjcuv2Od WhzvquqNDyLwAZay5SZxSKrVO0LPhu5H5tq/kyoDqQGAW5X7UjaQjpUM420eqEPGlwb4 WqexCDKMkRuEgwqGi5dOtKX9OHCvLHcDbwIJ7rQK7q2j7SDbp/5YLdFGotEV/8Sei/Ls QPCW8QlGpxeYlg4rWM5cUuup0cljBhW+q/wvtNSvioyzvBkHcQisnlH/BIzXTRSMJemD d61g== 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=J+wd2+pUjcZC43lfSwviQMzkkM1ScarpvYXfKeReU1s=; b=dh9elcyKmWOXuZhwXL+vLMMUju362Zv6qBdyCwTWafZk8+9lzlu528isDkgwZpgylo yGBmgIpmryssc26m2UL4iJjN8kHELnc7vnT09R3smlyOTnW2yWYX7iSHDTOK17mE4/1n cruazkGkl5PXgoCZsQc0ZzRB9obBqdE3ytShOM27Pc3AP1lfoKhX8YqqO5Uh0OkWOlQe akvZrz+HS7gLywEQj/hgG09JyBgg9uVjyd7h7RtNzc/yz2fRGB/2wNqE3j4CNySpCYG2 e5Ki1fBIoisLoQiSD24ZN3+Gck8haL63PLr+mW0O1EbU7EqPAEdYTV8js+A+EO7YIRrg 5aEg== 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 u24-v6si23534052pgk.72.2018.09.20.02.51.15; Thu, 20 Sep 2018 02:51:30 -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 S2387623AbeITPdP (ORCPT + 99 others); Thu, 20 Sep 2018 11:33:15 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12636 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732068AbeITPcy (ORCPT ); Thu, 20 Sep 2018 11:32:54 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id BE0FA4E6E8720; 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:10 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH 2/6] net: cxgb3: remove redundant null pointer check before kfree_skb Date: Thu, 20 Sep 2018 17:37:42 +0800 Message-ID: <1537436266-41955-3-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_offload.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c index 50cd660..84604af 100644 --- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c @@ -1302,8 +1302,7 @@ void cxgb3_offload_deactivate(struct adapter *adapter) rcu_read_unlock(); RCU_INIT_POINTER(tdev->l2opt, NULL); call_rcu(&d->rcu_head, clean_l2_data); - if (t->nofail_skb) - kfree_skb(t->nofail_skb); + kfree_skb(t->nofail_skb); kfree(t); } -- 1.7.12.4