mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: esas2r: add error handling for pci_enable_device
@ 2018-06-12  4:14 Zhouyang Jia
  0 siblings, 0 replies; only message in thread
From: Zhouyang Jia @ 2018-06-12  4:14 UTC (permalink / raw)
  Cc: Zhouyang Jia, Bradley Grove, James E.J. Bottomley,
	Martin K. Petersen, linux-scsi, linux-kernel

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@gmail.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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-12  4:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-12  4:14 [PATCH] scsi: esas2r: add error handling for pci_enable_device Zhouyang Jia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®