From: Liao Chen <liaochen4@huawei.com>
To: <GR-QLogic-Storage-Upstream@marvell.com>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <skashyap@marvell.com>, <jhasan@marvell.com>,
<James.Bottomley@HansenPartnership.com>,
<martin.petersen@oracle.com>, <njavali@marvell.com>
Subject: [PATCH] scsi: qedf: Fix potential null pointer dereference
Date: Fri, 13 Sep 2024 03:36:27 +0000 [thread overview]
Message-ID: <20240913033627.1465713-1-liaochen4@huawei.com> (raw)
qedf is checked to be null in this if branch, accessing its member will
cause a null pointer dereference. Fix it by passing a direct NULL into
the error function.
Fixes: 51071f0831ea ("scsi: qedf: Don't process stag work during unload and recovery")
Signed-off-by: Liao Chen <liaochen4@huawei.com>
---
drivers/scsi/qedf/qedf_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 4813087e58a1..9d4738db0e51 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -4021,7 +4021,7 @@ void qedf_stag_change_work(struct work_struct *work)
container_of(work, struct qedf_ctx, stag_work.work);
if (!qedf) {
- QEDF_ERR(&qedf->dbg_ctx, "qedf is NULL");
+ QEDF_ERR(NULL, "qedf is NULL");
return;
}
--
2.34.1
next reply other threads:[~2024-09-13 3:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-13 3:36 Liao Chen [this message]
2024-09-19 6:43 ` liaochen (A)
2024-09-19 16:11 ` Bart Van Assche
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=20240913033627.1465713-1-liaochen4@huawei.com \
--to=liaochen4@huawei.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=jhasan@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=njavali@marvell.com \
--cc=skashyap@marvell.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 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®