[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1567566992-8147-1-git-send-email-zhongjiang@huawei.com>
Date: Wed, 4 Sep 2019 11:16:32 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <martin.petersen@...cle.com>, <jejb@...ux.ibm.com>
CC: <linux-scsi@...r.kernel.org>, <zhongjiang@...wei.com>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] scsi: qedi: remove an redundant null check before kfree_skb
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 <zhongjiang@...wei.com>
---
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
Powered by blists - more mailing lists