All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Justin Tee <justin.tee@broadcom.com>
Cc: Paul Ely <paul.ely@broadcom.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: [PATCH] scsi: lpfc: remove unnnecessary NULL check
Date: Thu, 13 Aug 2026 10:09:32 +0300	[thread overview]
Message-ID: <an1trOAUeQmYEus_@stanley.mountain> (raw)

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


                 reply	other threads:[~2026-08-13  7:09 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=an1trOAUeQmYEus_@stanley.mountain \
    --to=error27@gmail.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=justin.tee@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=paul.ely@broadcom.com \
    /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 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.