* [PATCH] scsi: lpfc: remove unnnecessary NULL check
@ 2026-08-13 7:09 Dan Carpenter
2026-08-14 15:04 ` Paul Ely
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2026-08-13 7:09 UTC (permalink / raw)
To: Justin Tee
Cc: Paul Ely, James E.J. Bottomley, Martin K. Petersen, linux-scsi,
linux-kernel, kernel-janitors
The "evt_dat" variale is non-NULL at this point so there is no need to
check. Delete the check and pull the code in a tab.
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
drivers/scsi/lpfc/lpfc_bsg.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
index c95165905483..7354ae9ba8e5 100644
--- a/drivers/scsi/lpfc/lpfc_bsg.c
+++ b/drivers/scsi/lpfc/lpfc_bsg.c
@@ -1329,10 +1329,8 @@ lpfc_bsg_hba_get_event(struct bsg_job *job)
else
bsg_reply->reply_payload_rcv_len = 0;
- if (evt_dat) {
- kfree(evt_dat->data);
- kfree(evt_dat);
- }
+ kfree(evt_dat->data);
+ kfree(evt_dat);
spin_lock_irqsave(&phba->ct_ev_lock, flags);
lpfc_bsg_event_unref(evt);
--
2.53.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: lpfc: remove unnnecessary NULL check
2026-08-13 7:09 [PATCH] scsi: lpfc: remove unnnecessary NULL check Dan Carpenter
@ 2026-08-14 15:04 ` Paul Ely
2026-08-24 1:49 ` Martin K. Petersen (Oracle)
2026-08-26 15:20 ` Martin K. Petersen (Oracle)
2 siblings, 0 replies; 4+ messages in thread
From: Paul Ely @ 2026-08-14 15:04 UTC (permalink / raw)
To: Dan Carpenter
Cc: James E.J. Bottomley, Martin K. Petersen, linux-scsi,
linux-kernel, kernel-janitors, Nigel Kirkland
[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]
On Thu, Aug 13, 2026 at 3:09 AM Dan Carpenter <error27@gmail.com> wrote:
>
> The "evt_dat" variale is non-NULL at this point so there is no need to
> check. Delete the check and pull the code in a tab.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> drivers/scsi/lpfc/lpfc_bsg.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c
> index c95165905483..7354ae9ba8e5 100644
> --- a/drivers/scsi/lpfc/lpfc_bsg.c
> +++ b/drivers/scsi/lpfc/lpfc_bsg.c
> @@ -1329,10 +1329,8 @@ lpfc_bsg_hba_get_event(struct bsg_job *job)
> else
> bsg_reply->reply_payload_rcv_len = 0;
>
> - if (evt_dat) {
> - kfree(evt_dat->data);
> - kfree(evt_dat);
> - }
> + kfree(evt_dat->data);
> + kfree(evt_dat);
>
> spin_lock_irqsave(&phba->ct_ev_lock, flags);
> lpfc_bsg_event_unref(evt);
> --
> 2.53.0
>
Yes, evt_data was already checked for NULL and the follow up check has no value.
Looks good.
Reviewed-by: Paul Ely <paul.ely@broadcom.com>
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5453 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: lpfc: remove unnnecessary NULL check
2026-08-13 7:09 [PATCH] scsi: lpfc: remove unnnecessary NULL check Dan Carpenter
2026-08-14 15:04 ` Paul Ely
@ 2026-08-24 1:49 ` Martin K. Petersen (Oracle)
2026-08-26 15:20 ` Martin K. Petersen (Oracle)
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen (Oracle) @ 2026-08-24 1:49 UTC (permalink / raw)
To: Dan Carpenter
Cc: Justin Tee, Paul Ely, James E.J. Bottomley, Martin K. Petersen,
linux-scsi, linux-kernel, kernel-janitors
Dan,
> The "evt_dat" variale is non-NULL at this point so there is no need to
> check. Delete the check and pull the code in a tab.
Applied to 7.3/scsi-staging, thanks!
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] scsi: lpfc: remove unnnecessary NULL check
2026-08-13 7:09 [PATCH] scsi: lpfc: remove unnnecessary NULL check Dan Carpenter
2026-08-14 15:04 ` Paul Ely
2026-08-24 1:49 ` Martin K. Petersen (Oracle)
@ 2026-08-26 15:20 ` Martin K. Petersen (Oracle)
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen (Oracle) @ 2026-08-26 15:20 UTC (permalink / raw)
To: Justin Tee, Dan Carpenter
Cc: Martin K . Petersen, Paul Ely, James E.J. Bottomley, linux-scsi,
linux-kernel, kernel-janitors
On Thu, 13 Aug 2026 10:09:32 +0300, Dan Carpenter wrote:
> The "evt_dat" variale is non-NULL at this point so there is no need to
> check. Delete the check and pull the code in a tab.
Applied to 7.3/scsi-queue, thanks!
[1/1] scsi: lpfc: remove unnnecessary NULL check
https://git.kernel.org/mkp/scsi/c/0ec418204f23
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-26 15:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 7:09 [PATCH] scsi: lpfc: remove unnnecessary NULL check Dan Carpenter
2026-08-14 15:04 ` Paul Ely
2026-08-24 1:49 ` Martin K. Petersen (Oracle)
2026-08-26 15:20 ` Martin K. Petersen (Oracle)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.