[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1528776850-39672-1-git-send-email-jiazhouyang09@gmail.com>
Date: Tue, 12 Jun 2018 12:14:09 +0800
From: Zhouyang Jia <jiazhouyang09@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Zhouyang Jia <jiazhouyang09@...il.com>,
Bradley Grove <linuxdrivers@...otech.com>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] scsi: esas2r: add error handling for pci_enable_device
When pci_enable_device fails, the lack of error-handling code may
cause unexpected results.
This patch adds error-handling code after calling pci_enable_device.
Signed-off-by: Zhouyang Jia <jiazhouyang09@...il.com>
---
drivers/scsi/esas2r/esas2r_init.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c
index 9dffcb2..364538c 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -707,6 +707,9 @@ int esas2r_resume(struct pci_dev *pdev)
esas2r_log_dev(ESAS2R_LOG_INFO, &(pdev->dev),
"pci_enable_device() called");
rez = pci_enable_device(pdev);
+ if (rez)
+ goto error_exit;
+
pci_set_master(pdev);
if (!a) {
--
2.7.4
Powered by blists - more mailing lists