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]
Message-Id: <20220409134926.331728-1-zheyuma97@gmail.com>
Date:   Sat,  9 Apr 2022 21:49:26 +0800
From:   Zheyu Ma <zheyuma97@...il.com>
To:     sathya.prakash@...adcom.com, kashyap.desai@...adcom.com,
        sumit.saxena@...adcom.com, sreekanth.reddy@...adcom.com,
        jejb@...ux.ibm.com, martin.petersen@...cle.com
Cc:     mpi3mr-linuxdrv.pdl@...adcom.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org, Zheyu Ma <zheyuma97@...il.com>
Subject: [PATCH] scsi: mpi3mr: Fix an error code when probing the driver

During the process of driver probing, probe function should return < 0
for failure, otherwise kernel will treat value >= 0 as success.

Signed-off-by: Zheyu Ma <zheyuma97@...il.com>
---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index f7cd70a15ea6..240bfdf9788b 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -4222,9 +4222,10 @@ mpi3mr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	struct Scsi_Host *shost = NULL;
 	int retval = 0, i;
 
-	if (osintfc_mrioc_security_status(pdev)) {
+	retval = osintfc_mrioc_security_status(pdev);
+	if (retval) {
 		warn_non_secure_ctlr = 1;
-		return 1; /* For Invalid and Tampered device */
+		return retval; /* For Invalid and Tampered device */
 	}
 
 	shost = scsi_host_alloc(&mpi3mr_driver_template,
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ