From: Markus Elfring <Markus.Elfring@web.de>
To: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
James Bottomley <James.Bottomley@HansenPartnership.com>,
James Smart <james.smart@broadcom.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Ram Vegesna <ram.vegesna@broadcom.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] scsi: elx: efct: Delete an unnecessary check before kfree() in efct_hw_rx_post()
Date: Tue, 10 Jun 2025 13:13:12 +0200 [thread overview]
Message-ID: <c578f363-8614-4295-b178-2800764565fa@web.de> (raw)
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
reply other threads:[~2025-06-10 11:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c578f363-8614-4295-b178-2800764565fa@web.de \
--to=markus.elfring@web.de \
--cc=James.Bottomley@HansenPartnership.com \
--cc=james.smart@broadcom.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ram.vegesna@broadcom.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®