diff mbox series

scsi: pcmcia: fdomain: Fix an error code in probe()

Message ID 20210810084700.GC23810@kili
State New
Headers show
Series scsi: pcmcia: fdomain: Fix an error code in probe() | expand

Commit Message

Dan Carpenter Aug. 10, 2021, 8:47 a.m. UTC
If request_region() fails, the driver should return -EBUSY but this
code accidentally returns success.

Fixes: 8674a8aa2c39 ("scsi: fdomain: Add PCMCIA support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/scsi/pcmcia/fdomain_cs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Martin K. Petersen Aug. 16, 2021, 5:25 p.m. UTC | #1
Hi Dan!

> If request_region() fails, the driver should return -EBUSY but this

> code accidentally returns success.


Identical fix was merged as 632c4ae6da1d.

Thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/pcmcia/fdomain_cs.c b/drivers/scsi/pcmcia/fdomain_cs.c
index e42acf314d06..33df6a9ba9b5 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 = -EBUSY;
 		goto fail_disable;
+	}
 
 	sh = fdomain_create(link->resource[0]->start, link->irq, 7, &link->dev);
 	if (!sh) {