lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 9 Sep 2020 16:46:53 +0800
From:   Jing Xiangfeng <jingxiangfeng@...wei.com>
To:     <linuxdrivers@...otech.com>, <jejb@...ux.ibm.com>,
        <martin.petersen@...cle.com>
CC:     <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        <jingxiangfeng@...wei.com>
Subject: [PATCH] scsi: esas2r: prevent a potential NULL dereference in esas2r_probe()

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ