From: Maciej W. Rozycki Date: Tue, 29 May 2007 15:12:22 +0000 (+0100) Subject: defxx: Fix the handling of ioremap() failures X-Git-Tag: v2.6.22-rc4~90^2~3 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a32352661cc8e942897d205ba18f871ef7be597;p=linux-2.6 defxx: Fix the handling of ioremap() failures If ioremap_nocache() is unfortunate enough to fail, the error code is not set correctly leading to a false success from dfx_register(). This change fixes the problem. Signed-off-by: Maciej W. Rozycki Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/defxx.c b/drivers/net/defxx.c index 571d82f800..7df23dc281 100644 --- a/drivers/net/defxx.c +++ b/drivers/net/defxx.c @@ -566,6 +566,7 @@ static int __devinit dfx_register(struct device *bdev) bp->base.mem = ioremap_nocache(bar_start, bar_len); if (!bp->base.mem) { printk(KERN_ERR "%s: Cannot map MMIO\n", print_name); + err = -ENOMEM; goto err_out_region; } } else {