Commit e6d0262e authored by Shivasharan S's avatar Shivasharan S Committed by Greg Kroah-Hartman

scsi: megaraid_sas: Fix goto labels in error handling

[ Upstream commit 8a25fa17 ]

During init, if pci_alloc_irq_vectors() fails, the driver has not yet setup
the IRQs. Fix the goto labels and error handling for this case.
Signed-off-by: default avatarShivasharan S <shivasharan.srikanteshwara@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 83e67960
...@@ -5410,7 +5410,7 @@ static int megasas_init_fw(struct megasas_instance *instance) ...@@ -5410,7 +5410,7 @@ static int megasas_init_fw(struct megasas_instance *instance)
if (!instance->msix_vectors) { if (!instance->msix_vectors) {
i = pci_alloc_irq_vectors(instance->pdev, 1, 1, PCI_IRQ_LEGACY); i = pci_alloc_irq_vectors(instance->pdev, 1, 1, PCI_IRQ_LEGACY);
if (i < 0) if (i < 0)
goto fail_setup_irqs; goto fail_init_adapter;
} }
megasas_setup_reply_map(instance); megasas_setup_reply_map(instance);
...@@ -5619,9 +5619,8 @@ static int megasas_init_fw(struct megasas_instance *instance) ...@@ -5619,9 +5619,8 @@ static int megasas_init_fw(struct megasas_instance *instance)
fail_get_ld_pd_list: fail_get_ld_pd_list:
instance->instancet->disable_intr(instance); instance->instancet->disable_intr(instance);
fail_init_adapter:
megasas_destroy_irqs(instance); megasas_destroy_irqs(instance);
fail_setup_irqs: fail_init_adapter:
if (instance->msix_vectors) if (instance->msix_vectors)
pci_free_irq_vectors(instance->pdev); pci_free_irq_vectors(instance->pdev);
instance->msix_vectors = 0; instance->msix_vectors = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment