diff mbox series

scsi: acornscsi: Fix an error handling path in 'acornscsi_probe()'

Message ID 20200530081622.577888-1-christophe.jaillet@wanadoo.fr (mailing list archive)
State Mainlined
Commit 42c76c9848e13dbe0538d7ae0147a269dfa859cb
Headers show
Series scsi: acornscsi: Fix an error handling path in 'acornscsi_probe()' | expand

Commit Message

Christophe JAILLET May 30, 2020, 8:16 a.m. UTC
'ret' is known to be 0 at this point.
So, explicitly return -ENOMEM if one of the 'ecardm_iomap()' calls fail.

Fixes: e95a1b656a98 ("[ARM] rpc: acornscsi: update to new style ecard driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/scsi/arm/acornscsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Martin K. Petersen June 10, 2020, 2:41 a.m. UTC | #1
On Sat, 30 May 2020 10:16:22 +0200, Christophe JAILLET wrote:

> 'ret' is known to be 0 at this point.
> So, explicitly return -ENOMEM if one of the 'ecardm_iomap()' calls fail.

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: acornscsi: Fix an error handling path in acornscsi_probe()
      https://git.kernel.org/mkp/scsi/c/7960c0b29626
diff mbox series

Patch

diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index ddb52e7ba622..9a912fd0f70b 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -2911,8 +2911,10 @@  static int acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
 
 	ashost->base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
 	ashost->fast = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
-	if (!ashost->base || !ashost->fast)
+	if (!ashost->base || !ashost->fast) {
+		ret = -ENOMEM;
 		goto out_put;
+	}
 
 	host->irq = ec->irq;
 	ashost->host = host;