Add iounmap() to release RamIO that not released before returning;
Signed-off-by: Haoyang Liu <
ttttur...@hust.edu.cn>
---
drivers/char/applicom.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 69314532f38c..a455d85db7de 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -251,6 +251,7 @@ static int __init applicom_init(void)
else {
printk(KERN_INFO "ac.o: No PCI boards found.\n");
printk(KERN_INFO "ac.o: For an ISA board you must supply memory and irq parameters.\n");
+ iounmap(RamIO);
return -ENXIO;
}
}
@@ -335,8 +336,10 @@ static int __init applicom_init(void)
return 0;
}
- else
+ else {
+ iounmap(RamIO);
return -ENXIO;
+ }
out:
for (i = 0; i < MAX_BOARD; i++) {
@@ -346,6 +349,7 @@ static int __init applicom_init(void)
free_irq(apbs[i].irq, &dummy);
iounmap(apbs[i].RamIO);
}
+ iounmap(RamIO);
return ret;
}
--
2.25.1