mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] scsi: qedf: Fix potential null pointer dereference
@ 2024-09-20  2:08 Liao Chen
  2024-09-20 16:43 ` Bart Van Assche
  0 siblings, 1 reply; 2+ messages in thread
From: Liao Chen @ 2024-09-20  2:08 UTC (permalink / raw)
  To: GR-QLogic-Storage-Upstream, linux-scsi, linux-kernel
  Cc: skashyap, jhasan, James.Bottomley, martin.petersen, bvanassche

qedf is checked to be null in this if branch, accessing its member will
cause a null pointer dereference. As suggested by Bart, fix it by
deleting the logic since qedf cannot be NULL in this function.

Signed-off-by: Liao Chen <liaochen4@huawei.com>
---
 drivers/scsi/qedf/qedf_main.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index cf13148ba281..df756f3eef3e 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -4018,11 +4018,6 @@ void qedf_stag_change_work(struct work_struct *work)
 	struct qedf_ctx *qedf =
 	    container_of(work, struct qedf_ctx, stag_work.work);
 
-	if (!qedf) {
-		QEDF_ERR(&qedf->dbg_ctx, "qedf is NULL");
-		return;
-	}
-
 	if (test_bit(QEDF_IN_RECOVERY, &qedf->flags)) {
 		QEDF_ERR(&qedf->dbg_ctx,
 			 "Already is in recovery, hence not calling software context reset.\n");
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-20 16:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-20  2:08 [PATCH -next] scsi: qedf: Fix potential null pointer dereference Liao Chen
2024-09-20 16:43 ` Bart Van Assche

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®