scsi: acornscsi: Fix an error handling path in acornscsi_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 30 May 2020 08:16:22 +0000 (10:16 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 10 Jun 2020 11:50:25 +0000 (07:50 -0400)
'ret' is known to be 0 at this point.  Explicitly return -ENOMEM if one of
the 'ecardm_iomap()' calls fail.

Link: https://lore.kernel.org/r/20200530081622.577888-1-christophe.jaillet@wanadoo.fr
Fixes: e95a1b656a98 ("[ARM] rpc: acornscsi: update to new style ecard driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/arm/acornscsi.c

index ddb52e7ba6226b51d4170944ccd3461b7c5d1b69..9a912fd0f70b5563107b39cd63c84d389155df24 100644 (file)
@@ -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;