Skip to content

Commit 61f0c3c

Browse files
weiping zhangmartinkpetersen
authored andcommitted
scsi: megaraid_sas: fix error handle in megasas_probe_one
megasas_mgmt_info.max_index has increased by 1 before megasas_io_attach, if megasas_io_attach return error, then goto fail_io_attach, megasas_mgmt_info.instance has a wrong index here. So first reduce max_index and then set that instance to NULL. Signed-off-by: weiping zhang <zhangweiping@didichuxing.com> Acked-by: Sumit Saxena <sumit.saxena@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 424f727 commit 61f0c3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/megaraid/megaraid_sas_base.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6228,8 +6228,8 @@ static int megasas_probe_one(struct pci_dev *pdev,
62286228
fail_start_aen:
62296229
fail_io_attach:
62306230
megasas_mgmt_info.count--;
6231-
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
62326231
megasas_mgmt_info.max_index--;
6232+
megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL;
62336233

62346234
instance->instancet->disable_intr(instance);
62356235
megasas_destroy_irqs(instance);

0 commit comments

Comments
 (0)