Skip to content

Commit 42c76c9

Browse files
tititiou36martinkpetersen
authored andcommitted
scsi: acornscsi: Fix an error handling path in acornscsi_probe()
'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/[email protected] Fixes: e95a1b6 ("[ARM] rpc: acornscsi: update to new style ecard driver") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent f47c240 commit 42c76c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/scsi/arm/acornscsi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2911,8 +2911,10 @@ static int acornscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
29112911

29122912
ashost->base = ecardm_iomap(ec, ECARD_RES_MEMC, 0, 0);
29132913
ashost->fast = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
2914-
if (!ashost->base || !ashost->fast)
2914+
if (!ashost->base || !ashost->fast) {
2915+
ret = -ENOMEM;
29152916
goto out_put;
2917+
}
29162918

29172919
host->irq = ec->irq;
29182920
ashost->host = host;

0 commit comments

Comments
 (0)