mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
scsi: megaraid_sas: Bail out the driver load if ld_list_query fails
Error handling: Bail out the driver load if key FW cmds (LD_LIST) are not return successful. Clean up error handling in megasas_init_fw. Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Shivasharan S <shivasharan.srikanteshwara@broadcom.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
7a7ae4f192
commit
72bff2d1d0
1 changed files with 5 additions and 5 deletions
|
@ -5352,7 +5352,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
|||
(MEGASAS_MAX_PD * sizeof(struct megasas_pd_list)));
|
||||
if (megasas_get_pd_list(instance) < 0) {
|
||||
dev_err(&instance->pdev->dev, "failed to get PD list\n");
|
||||
goto fail_get_pd_list;
|
||||
goto fail_get_ld_pd_list;
|
||||
}
|
||||
|
||||
memset(instance->ld_ids, 0xff, MEGASAS_MAX_LD_IDS);
|
||||
|
@ -5388,7 +5388,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
|||
|
||||
if (megasas_ld_list_query(instance,
|
||||
MR_LD_QUERY_TYPE_EXPOSED_TO_HOST))
|
||||
megasas_get_ld_list(instance);
|
||||
goto fail_get_ld_pd_list;
|
||||
|
||||
/*
|
||||
* Compute the max allowed sectors per IO: The controller info has two
|
||||
|
@ -5507,8 +5507,6 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
|||
|
||||
fail_get_ld_pd_list:
|
||||
instance->instancet->disable_intr(instance);
|
||||
fail_get_pd_list:
|
||||
instance->instancet->disable_intr(instance);
|
||||
fail_init_adapter:
|
||||
megasas_destroy_irqs(instance);
|
||||
fail_setup_irqs:
|
||||
|
@ -5520,9 +5518,11 @@ static int megasas_init_fw(struct megasas_instance *instance)
|
|||
instance->ctrl_info = NULL;
|
||||
iounmap(instance->reg_set);
|
||||
|
||||
fail_ioremap:
|
||||
fail_ioremap:
|
||||
pci_release_selected_regions(instance->pdev, 1<<instance->bar);
|
||||
|
||||
dev_err(&instance->pdev->dev, "Failed from %s %d\n",
|
||||
__func__, __LINE__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue