pcmcia: add error handling for pcmcia_enable_device in qlogic_stub

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
in the qlogic_stub scsi driver.

Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com>
Cc: James E.J. Bottomley <jejb@linux.vnet.ibm.com>
Cc: Martin K. Petersen <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
[linux@dominikbrodowski.net: update commit message]
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
Zhouyang Jia 2018-06-15 07:41:38 +08:00 коммит произвёл Dominik Brodowski
Родитель be826ada52
Коммит 5f17af054d
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -254,8 +254,12 @@ static void qlogic_release(struct pcmcia_device *link)
static int qlogic_resume(struct pcmcia_device *link) static int qlogic_resume(struct pcmcia_device *link)
{ {
scsi_info_t *info = link->priv; 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) || if ((info->manf_id == MANFID_MACNICA) ||
(info->manf_id == MANFID_PIONEER) || (info->manf_id == MANFID_PIONEER) ||
(info->manf_id == 0x0098)) { (info->manf_id == 0x0098)) {