scsi: pm80xx: Cleanup initialization loading fail path
authorPeter Chang <dpf@google.com>
Mon, 16 Mar 2020 07:49:04 +0000 (13:19 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 17 Mar 2020 17:57:16 +0000 (13:57 -0400)
commitb40f28820fbafbcb0e0ec555fc2bca76ac1d9612
treead0a666d16ed3496d9268b08e87b4135edd665eb
parent9d9c7c20fb35444fe26bf284fb89006fd7767ab7
scsi: pm80xx: Cleanup initialization loading fail path

1) Move the instance tracking down after we think the instance is good to
   go. Avoids having a use-after free.

2) There are goto targets for trying to cleanup if the hw fails to
   initialize, but there's some overlap depending on who thinks they own
   the sub-structures.

Link: https://lore.kernel.org/r/20200316074906.9119-5-deepak.ukey@microchip.com
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Peter Chang <dpf@google.com>
Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Radha Ramachandran <radha@google.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/pm8001/pm8001_init.c