Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp178675ybe; Tue, 3 Sep 2019 20:21:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwdbSCP2/5sOidPTXiPNwzf0yKzWd5Lwl5CFysX4tVpA3BJUT4gBJo0qjwLCqKO3XaWbm5 X-Received: by 2002:a17:90a:d351:: with SMTP id i17mr2656409pjx.54.1567567290696; Tue, 03 Sep 2019 20:21:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567567290; cv=none; d=google.com; s=arc-20160816; b=vrSCsyiWEQg8x9yb/2hgY7I18bPhSgLjbTgdTHp4nba+Svqc76pPJbbdYewn8C1QNT tUZv1ItBrQ4MQDQePOJK9ohsH1trzONXFH7sTdwZX45MrNDM1A7sWeTzY2PFPWnGVhua es+WpkwqJ6+/z9+Zs05vL5E2F4BwjeAat0a5gtQCPFwBTn6GXAh06IXEsampucWbdYGC KYqrdJzRH3h5VKdohfbV1WGjyOebMdcUaso9IJNgAxJkJAhUb/iB/oFjv5ByJDYvj5fS KfymsoMtJDYueSgvUZ2Vx4tA2rGTnwKyWZAgCbID7jYWHukEbjM0hNqrfwiEDQZ4j1FA r5ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=uQ8c2hBAHy/wA7Kn2wfWEfQUq17D0FUoPzsXOAnJ8J4=; b=l2KWQzhDAWYCpvWKrAsX+KyLnw0YVstKpXxmGvC7zgNfgMYayWCKmKIJJ/PV8QM5BJ 5JPXhxSBTHdAimV+qOxcJJ3+9T1Qw5WFJ/AVXWbOOIya0pFRcNW13yIqAFsTJ8FLazfK 5bOf/nVI0KsgdAqBPnz1Dm32PHs9aMa831YcIV0QsxtGBUJzaohd5R0AUE3SdFP+YdWr awmiRTSC2n5brs+FEJSAc9EdTVG6I6ihKeVRFnyvVLIfJvqTquY6mQ6kbugNHbN61s2u E8VW3QOhr7LbegGdJWIV8o5jyGZSvBAgzkZdqYlA2+Oytjx94MDU/GtRCQuQzlb3KYGH W+jg== 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 11si3442536pla.399.2019.09.03.20.21.15; Tue, 03 Sep 2019 20:21: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 S1728117AbfIDDTi (ORCPT + 99 others); Tue, 3 Sep 2019 23:19:38 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6197 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727065AbfIDDTh (ORCPT ); Tue, 3 Sep 2019 23:19:37 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id AD1F964A5027FFA3A10A; Wed, 4 Sep 2019 11:19:34 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Wed, 4 Sep 2019 11:19:25 +0800 From: zhong jiang To: , CC: , , Subject: [PATCH] scsi: qedi: remove an redundant null check before kfree_skb Date: Wed, 4 Sep 2019 11:16:32 +0800 Message-ID: <1567566992-8147-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 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 null pointer into account. Hence it is unnecessary to check it before kfree_skb. Just remove the condition. Signed-off-by: zhong jiang --- drivers/scsi/qedi/qedi_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index acb930b..dabf425 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -789,8 +789,7 @@ static void qedi_ll2_free_skbs(struct qedi_ctx *qedi) spin_lock_bh(&qedi->ll2_lock); list_for_each_entry_safe(work, work_tmp, &qedi->ll2_skb_list, list) { list_del(&work->list); - if (work->skb) - kfree_skb(work->skb); + kfree_skb(work->skb); kfree(work); } spin_unlock_bh(&qedi->ll2_lock); -- 1.7.12.4