[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201112080351.174338-1-jingxiangfeng@huawei.com>
Date: Thu, 12 Nov 2020 16:03:51 +0800
From: Jing Xiangfeng <jingxiangfeng@...wei.com>
To: <aacraid@...rosemi.com>, <jejb@...ux.ibm.com>,
<martin.petersen@...cle.com>, <Mahesh.Rajashekhara@...s.com>,
<JBottomley@...n.com>, <thenzl@...hat.com>,
<Karthikeya.Sunkesula@...s.com>, <Murthy.Bhat@...s.com>
CC: <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<jingxiangfeng@...wei.com>
Subject: [PATCH] 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")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@...wei.com>
---
drivers/scsi/aacraid/linit.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index a3aee146537b..13323aaaa707 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -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
--
2.17.1
Powered by blists - more mailing lists