mirror of https://gitee.com/openkylin/linux.git
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 <macro@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
34dd962b74
commit
8a32352661
|
@ -566,6 +566,7 @@ static int __devinit dfx_register(struct device *bdev)
|
||||||
bp->base.mem = ioremap_nocache(bar_start, bar_len);
|
bp->base.mem = ioremap_nocache(bar_start, bar_len);
|
||||||
if (!bp->base.mem) {
|
if (!bp->base.mem) {
|
||||||
printk(KERN_ERR "%s: Cannot map MMIO\n", print_name);
|
printk(KERN_ERR "%s: Cannot map MMIO\n", print_name);
|
||||||
|
err = -ENOMEM;
|
||||||
goto err_out_region;
|
goto err_out_region;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue