Skip to contentSkip to conversation

scsi: elx: efct: Delete an unnecessary check before kfree() in efct_hw_rx_post()

PATCH New Markus Elfring 1 participant 1 message Jun 10, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: elx: efct: Delete an unnecessary check before kfree() in efct_hw_rx_post()

From: Markus Elfring <[email protected]>
Date: Tue, 10 Jun 2025 13:03:50 +0200

It can be known that the function “kfree” performs a null pointer check for its input parameter.
It is therefore not needed to repeat such a check before its call.

Thus remove a redundant pointer check.

The source code was transformed by using the Coccinelle software.

---
 drivers/scsi/elx/efct/efct_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/elx/efct/efct_hw.c +1 -1
index 5a5525054d71..4ba1b12576c2 100644
@@ -1314,7 +1314,7 @@ efct_hw_rx_post(struct efct_hw *hw)
 			break;
 	}
 
-	if (rc && hw->seq_pool)
+	if (rc)
 		kfree(hw->seq_pool);
 
 	return rc;
Signature · 1 line
2.49.0