[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1529019701-55981-1-git-send-email-jiazhouyang09@gmail.com>
Date: Fri, 15 Jun 2018 07:41:38 +0800
From: Zhouyang Jia <jiazhouyang09@...il.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Zhouyang Jia <jiazhouyang09@...il.com>,
"James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Hannes Reinecke <hare@...e.com>,
Johannes Thumshirn <jthumshirn@...e.de>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v3] pcmcia: add error handling for pcmcia_enable_device
When pcmcia_enable_device fails, the lack of error-handling code may
cause unexpected results.
This patch adds error-handling code after calling pcmcia_enable_device.
Signed-off-by: Zhouyang Jia <jiazhouyang09@...il.com>
---
v1->v2:
- Remove pcmcia_disable_device.
v2->v3:
- Change the return value.
---
drivers/scsi/pcmcia/qlogic_stub.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 0556054..9d5751a 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -254,8 +254,12 @@ static void qlogic_release(struct pcmcia_device *link)
static int qlogic_resume(struct pcmcia_device *link)
{
scsi_info_t *info = link->priv;
+ int ret;
+
+ ret = pcmcia_enable_device(link);
+ if (ret)
+ return ret;
- pcmcia_enable_device(link);
if ((info->manf_id == MANFID_MACNICA) ||
(info->manf_id == MANFID_PIONEER) ||
(info->manf_id == 0x0098)) {
--
2.7.4
Powered by blists - more mailing lists