Skip to contentSkip to conversation

scsi: qedi: Remove redundant null check

PATCH Applied Xu Wang 2 participants 2 messages Aug 27, 2020 – Sep 9, 2020

Subsystems (2)
lore
Share & tools
lore

Xu Wang

author
#0 lore raw

PATCH 1/1 scsi: qedi: Remove redundant null check

Because kfree_skb already checked NULL skb parameter, so the additional check is unnecessary, just remove it.

---
 drivers/scsi/qedi/qedi_main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/scsi/qedi/qedi_main.c +1 -2
index 6f038ae5efca..e42437ec23a8 100644
@@ -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);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 2 lines · Xu Wang

Because kfree_skb already checked NULL skb parameter, so the additional check is unnecessary, just remove it.

Applied to 5.10/scsi-queue, thanks!

[1/1] scsi: qedi: Remove redundant NULL check

      https://git.kernel.org/mkp/scsi/c/9535f2152ace
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering