scsi: qedf: Fix return values of the probe function
Subsystems (2)
PATCH 1/1 scsi: qedf: Fix return values of the probe function
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.
--- drivers/scsi/qedf/qedf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/qedf/qedf_main.c +2 -2
@@ -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() */
Signature · 1 line
2.17.6
Hi Zheyu,
Thanks for the patch.
Quoted 45 lines
-----Original Message-----
From: Zheyu Ma <[email protected]>
Sent: Wednesday, October 20, 2021 8:03 PM
To: [email protected]; [email protected]; Saurav Kashyap <[email protected]>; Javed Hasan <[email protected]>; GR-QLogic- Storage-Upstream <[email protected]>
Cc: [email protected]; [email protected]; Zheyu Ma <[email protected]>
Subject: [EXT] [PATCH] scsi: qedf: Fix return values of the probe functionExternal Email
----------------------------------------------------------------------
qedf_set_fcoe_pf_param()propagates the return value to the probe function__qedf_probe()and then hitslocal_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 <[email protected]>--- drivers/scsi/qedf/qedf_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/scsi/qedf/qedf_main.c +2
-2@@ -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; }
Quoted 3 lines
/* Calculate SQ PBL size in the same manner as in
qedf_sq_alloc()*/
--
2.17.6
Thanks,
~Saurav