All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zheyu Ma <zheyuma97@gmail.com>
To: sathya.prakash@broadcom.com, kashyap.desai@broadcom.com,
	sumit.saxena@broadcom.com, sreekanth.reddy@broadcom.com,
	jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: mpi3mr-linuxdrv.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, Zheyu Ma <zheyuma97@gmail.com>
Subject: [PATCH] scsi: mpi3mr: Fix an error code when probing the driver
Date: Sat,  9 Apr 2022 21:49:26 +0800	[thread overview]
Message-ID: <20220409134926.331728-1-zheyuma97@gmail.com> (raw)

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


             reply	other threads:[~2022-04-09 13:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-09 13:49 Zheyu Ma [this message]
2022-04-12 17:58 ` [PATCH] scsi: mpi3mr: Fix an error code when probing the driver Sathya Prakash Veerichetty
2022-04-13  9:27   ` Zheyu Ma

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=20220409134926.331728-1-zheyuma97@gmail.com \
    --to=zheyuma97@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=kashyap.desai@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mpi3mr-linuxdrv.pdl@broadcom.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=sumit.saxena@broadcom.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.