From: Jing Xiangfeng <jingxiangfeng@huawei.com>
To: <linuxdrivers@attotech.com>, <jejb@linux.ibm.com>,
<martin.petersen@oracle.com>
Cc: <linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<jingxiangfeng@huawei.com>
Subject: [PATCH] scsi: esas2r: prevent a potential NULL dereference in esas2r_probe()
Date: Wed, 9 Sep 2020 16:46:53 +0800 [thread overview]
Message-ID: <20200909084653.79341-1-jingxiangfeng@huawei.com> (raw)
esas2r_probe() calls scsi_host_put() in an error path. However,
esas2r_log_dev() may hit a potential NULL dereference. So use NUll instead.
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
drivers/scsi/esas2r/esas2r_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c
index 7b49e2e9fcde..7d3fa9dac4ce 100644
--- a/drivers/scsi/esas2r/esas2r_main.c
+++ b/drivers/scsi/esas2r/esas2r_main.c
@@ -456,7 +456,7 @@ static int esas2r_probe(struct pci_dev *pcid,
scsi_host_put(host);
- esas2r_log_dev(ESAS2R_LOG_INFO, &(host->shost_gendev),
+ esas2r_log_dev(ESAS2R_LOG_INFO, NULL,
"pci_set_drvdata(%p, NULL) called",
pcid);
--
2.17.1
next reply other threads:[~2020-09-09 8:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-09 8:46 Jing Xiangfeng [this message]
2020-09-15 21:44 ` [PATCH] scsi: esas2r: prevent a potential NULL dereference in esas2r_probe() Martin K. Petersen
2020-09-16 12:13 ` Jing Xiangfeng
2020-09-16 12:28 ` Jing Xiangfeng
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=20200909084653.79341-1-jingxiangfeng@huawei.com \
--to=jingxiangfeng@huawei.com \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxdrivers@attotech.com \
--cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).