[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20201117023845.26736-1-liwei391@huawei.com>
Date: Tue, 17 Nov 2020 10:38:44 +0800
From: Wei Li <liwei391@...wei.com>
To: "James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
Ondrej Zary <linux@...y.sk>
CC: <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<guohanjun@...wei.com>
Subject: [PATCH] scsi: fdomain: Fix error return code in fdomain_probe()
When it fail to request_region, it just jump to 'fail_disable',
while the 'ret' is not updated. So assign the return code before
that.
Fixes: 8674a8aa2c39 ("scsi: fdomain: Add PCMCIA support")
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Wei Li <liwei391@...wei.com>
---
drivers/scsi/pcmcia/fdomain_cs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/pcmcia/fdomain_cs.c b/drivers/scsi/pcmcia/fdomain_cs.c
index e42acf314d06..6bde57ed6c50 100644
--- a/drivers/scsi/pcmcia/fdomain_cs.c
+++ b/drivers/scsi/pcmcia/fdomain_cs.c
@@ -45,8 +45,10 @@ static int fdomain_probe(struct pcmcia_device *link)
goto fail_disable;
if (!request_region(link->resource[0]->start, FDOMAIN_REGION_SIZE,
- "fdomain_cs"))
+ "fdomain_cs")) {
+ ret = -ENOMEM;
goto fail_disable;
+ }
sh = fdomain_create(link->resource[0]->start, link->irq, 7, &link->dev);
if (!sh) {
--
2.17.1
Powered by blists - more mailing lists