Skip to contentSkip to conversation

scsi: aacraid: Correct goto target in aac_resume()

PATCH New Jing Xiangfeng 1 participant 1 message Nov 12, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: aacraid: Correct goto target in aac_resume()

In current code, it jumps to call pci_disable_device() when pci_enable_device() failes to initialize device. Add a label 'fail_enable' to fix it.

Fixes de665f28f788 ("aacraid: Add Power Management support")
---
 drivers/scsi/aacraid/linit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/linit.c +3 -2
index a3aee146537b..13323aaaa707 100644
@@ -1943,7 +1943,7 @@ static int aac_resume(struct pci_dev *pdev)
 	r = pci_enable_device(pdev);
 
 	if (r)
-		goto fail_device;
+		goto fail_enable;
 
 	pci_set_master(pdev);
 	if (aac_acquire_resources(aac))
@@ -1958,9 +1958,10 @@ static int aac_resume(struct pci_dev *pdev)
 	return 0;
 
 fail_device:
+	pci_disable_device(pdev);
+fail_enable:
 	printk(KERN_INFO "%s%d: resume failed.\n", aac->name, aac->id);
 	scsi_host_put(shost);
-	pci_disable_device(pdev);
 	return -ENODEV;
 }
 #endif
Signature · 1 line
2.17.1