linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheyu Ma <zheyuma97@gmail.com>
To: jejb@linux.ibm.com, martin.petersen@oracle.com,
	skashyap@marvell.com, jhasan@marvell.com,
	GR-QLogic-Storage-Upstream@marvell.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Zheyu Ma <zheyuma97@gmail.com>
Subject: [PATCH] scsi: qedf: Fix return values of the probe function
Date: Wed, 20 Oct 2021 14:33:08 +0000	[thread overview]
Message-ID: <1634740388-27238-1-git-send-email-zheyuma97@gmail.com> (raw)

qedf_set_fcoe_pf_param() propagates the return value to the probe
function __qedf_probe() and then hits local_pci_probe().

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

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
---
 drivers/scsi/qedf/qedf_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 42d0d941dba5..52f2a52bea2c 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -3161,14 +3161,14 @@ static int qedf_set_fcoe_pf_param(struct qedf_ctx *qedf)
 
 	if (!qedf->p_cpuq) {
 		QEDF_ERR(&(qedf->dbg_ctx), "dma_alloc_coherent failed.\n");
-		return 1;
+		return -ENOMEM;
 	}
 
 	rval = qedf_alloc_global_queues(qedf);
 	if (rval) {
 		QEDF_ERR(&(qedf->dbg_ctx), "Global queue allocation "
 			  "failed.\n");
-		return 1;
+		return rval;
 	}
 
 	/* Calculate SQ PBL size in the same manner as in qedf_sq_alloc() */
-- 
2.17.6


             reply	other threads:[~2021-10-20 14:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 14:33 Zheyu Ma [this message]
2021-10-21  4:27 ` [EXT] [PATCH] scsi: qedf: Fix return values of the probe function Saurav Kashyap

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=1634740388-27238-1-git-send-email-zheyuma97@gmail.com \
    --to=zheyuma97@gmail.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=jhasan@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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;
as well as URLs for NNTP newsgroup(s).