* [PATCH] scsi: elx: efct: Delete an unnecessary check before kfree() in efct_hw_rx_post()
@ 2025-06-10 11:13 Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2025-06-10 11:13 UTC (permalink / raw)
To: linux-scsi, target-devel, James Bottomley, James Smart,
Martin K. Petersen, Ram Vegesna
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
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.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/scsi/elx/efct/efct_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/elx/efct/efct_hw.c b/drivers/scsi/elx/efct/efct_hw.c
index 5a5525054d71..4ba1b12576c2 100644
--- a/drivers/scsi/elx/efct/efct_hw.c
+++ b/drivers/scsi/elx/efct/efct_hw.c
@@ -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;
--
2.49.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-06-10 11:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-10 11:13 [PATCH] scsi: elx: efct: Delete an unnecessary check before kfree() in efct_hw_rx_post() Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®