* [PATCH 1/1] scsi: esas2r: fix unchecked return value
@ 2017-04-23 5:32 Pan Bian
0 siblings, 0 replies; only message in thread
From: Pan Bian @ 2017-04-23 5:32 UTC (permalink / raw)
To: Bradley Grove, James E.J. Bottomley, Martin K. Petersen
Cc: linux-scsi, linux-kernel, Pan Bian
Function pci_enable_device() returns a negative errno on failure, and
its return value should be validated. In function esas2r_resume(), its
return value is ignored. This patch fixes the bug.
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
drivers/scsi/esas2r/esas2r_init.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/esas2r/esas2r_init.c b/drivers/scsi/esas2r/esas2r_init.c
index 6432a50..f482664 100644
--- a/drivers/scsi/esas2r/esas2r_init.c
+++ b/drivers/scsi/esas2r/esas2r_init.c
@@ -728,6 +728,8 @@ 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) {
--
1.9.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-04-23 5:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-23 5:32 [PATCH 1/1] scsi: esas2r: fix unchecked return value Pan Bian
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®