summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRanjan Kumar <ranjan.kumar@broadcom.com>2023-02-28 06:08:33 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2023-03-06 18:33:12 -0500
commitba8a9ba41fbde250fd8b0ed1e5dad0dc9318df46 (patch)
treee51164ab1192b5c446f40dddc70436e0509459df /drivers
parent0a319f1629495d27879b7ebf6eee62b8cf6e4c37 (diff)
downloadlinux-stable-ba8a9ba41fbde250fd8b0ed1e5dad0dc9318df46.tar.gz
linux-stable-ba8a9ba41fbde250fd8b0ed1e5dad0dc9318df46.tar.bz2
linux-stable-ba8a9ba41fbde250fd8b0ed1e5dad0dc9318df46.zip
scsi: mpi3mr: Return proper values for failures in firmware init path
Return proper non-zero return values for all the cases when the controller initialization and re-initialization fails. Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com> Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com> Link: https://lore.kernel.org/r/20230228140835.4075-5-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/mpi3mr/mpi3mr_fw.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr_fw.c b/drivers/scsi/mpi3mr/mpi3mr_fw.c
index fa903a70baac..29acf6111db3 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@ -3840,8 +3840,10 @@ retry_init:
dprint_init(mrioc, "allocating config page buffers\n");
mrioc->cfg_page = dma_alloc_coherent(&mrioc->pdev->dev,
MPI3MR_DEFAULT_CFG_PAGE_SZ, &mrioc->cfg_page_dma, GFP_KERNEL);
- if (!mrioc->cfg_page)
+ if (!mrioc->cfg_page) {
+ retval = -1;
goto out_failed_noretry;
+ }
mrioc->cfg_page_sz = MPI3MR_DEFAULT_CFG_PAGE_SZ;
@@ -3903,8 +3905,10 @@ retry_init:
dprint_init(mrioc, "allocating memory for throttle groups\n");
sz = sizeof(struct mpi3mr_throttle_group_info);
mrioc->throttle_groups = kcalloc(mrioc->num_io_throttle_group, sz, GFP_KERNEL);
- if (!mrioc->throttle_groups)
+ if (!mrioc->throttle_groups) {
+ retval = -1;
goto out_failed_noretry;
+ }
}
retval = mpi3mr_enable_events(mrioc);
@@ -3924,6 +3928,7 @@ out_failed:
mpi3mr_memset_buffers(mrioc);
goto retry_init;
}
+ retval = -1;
out_failed_noretry:
ioc_err(mrioc, "controller initialization failed\n");
mpi3mr_issue_reset(mrioc, MPI3_SYSIF_HOST_DIAG_RESET_ACTION_DIAG_FAULT,
@@ -4036,6 +4041,7 @@ retry_init:
ioc_err(mrioc,
"cannot create minimum number of operational queues expected:%d created:%d\n",
mrioc->shost->nr_hw_queues, mrioc->num_op_reply_q);
+ retval = -1;
goto out_failed_noretry;
}
@@ -4102,6 +4108,7 @@ out_failed:
mpi3mr_memset_buffers(mrioc);
goto retry_init;
}
+ retval = -1;
out_failed_noretry:
ioc_err(mrioc, "controller %s is failed\n",
(is_resume)?"resume":"re-initialization");