diff options
author | weiping zhang <zhangweiping@didichuxing.com> | 2017-08-08 01:26:57 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-08-16 20:01:30 -0400 |
commit | 61f0c3c7a0fd37f252b0f23c237973ddf4c21ea7 (patch) | |
tree | 9b8706240ff53716a967fdeaf5fe3f20946a6d36 /drivers | |
parent | 424f727b94132a4193af401dd823c44612d1d59f (diff) | |
download | linux-stable-61f0c3c7a0fd37f252b0f23c237973ddf4c21ea7.tar.gz linux-stable-61f0c3c7a0fd37f252b0f23c237973ddf4c21ea7.tar.bz2 linux-stable-61f0c3c7a0fd37f252b0f23c237973ddf4c21ea7.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/megaraid/megaraid_sas_base.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 316c3df0c3fd..71c4746341ea 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -6228,8 +6228,8 @@ static int megasas_probe_one(struct pci_dev *pdev, fail_start_aen: fail_io_attach: megasas_mgmt_info.count--; - megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL; megasas_mgmt_info.max_index--; + megasas_mgmt_info.instance[megasas_mgmt_info.max_index] = NULL; instance->instancet->disable_intr(instance); megasas_destroy_irqs(instance); |