scsi: megaraid_sas: fix error handle in megasas_probe_one
authorweiping zhang <zhangweiping@didichuxing.com>
Mon, 7 Aug 2017 17:26:57 +0000 (01:26 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 17 Aug 2017 00:01:30 +0000 (20:01 -0400)
commit61f0c3c7a0fd37f252b0f23c237973ddf4c21ea7
tree9b8706240ff53716a967fdeaf5fe3f20946a6d36
parent424f727b94132a4193af401dd823c44612d1d59f
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>
drivers/scsi/megaraid/megaraid_sas_base.c