diff options
author | Amol Lad <amol@verismonetworks.com> | 2006-09-21 08:42:43 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-09-22 05:24:31 -0400 |
commit | 25f0c659fe64832d8ee06aa623fffaad708dcf8b (patch) | |
tree | b5740156ac2ce5e39aaaba32ddb21b03379abb48 /drivers/mtd/maps/ebony.c | |
parent | dd8e9ed6ed544e2b924429d29cd2a6b55590109b (diff) |
ioremap balanced with iounmap for drivers/mtd subsystem
ioremap must be balanced by an iounmap and failing to do so can result
in a memory leak.
Tested (compilation only) with:
- allmodconfig
- Modifying drivers/mtd/maps/Kconfig and drivers/mtd/nand/Kconfig to
make sure that the changed file is compiling without warning
Signed-off-by: Amol Lad <amol@verismonetworks.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/maps/ebony.c')
-rw-r--r-- | drivers/mtd/maps/ebony.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/maps/ebony.c b/drivers/mtd/maps/ebony.c index 641e1dd8479e..1488bb92f26f 100644 --- a/drivers/mtd/maps/ebony.c +++ b/drivers/mtd/maps/ebony.c | |||
@@ -108,6 +108,7 @@ int __init init_ebony(void) | |||
108 | ARRAY_SIZE(ebony_small_partitions)); | 108 | ARRAY_SIZE(ebony_small_partitions)); |
109 | } else { | 109 | } else { |
110 | printk("map probe failed for flash\n"); | 110 | printk("map probe failed for flash\n"); |
111 | iounmap(ebony_small_map.virt); | ||
111 | return -ENXIO; | 112 | return -ENXIO; |
112 | } | 113 | } |
113 | 114 | ||
@@ -117,6 +118,7 @@ int __init init_ebony(void) | |||
117 | 118 | ||
118 | if (!ebony_large_map.virt) { | 119 | if (!ebony_large_map.virt) { |
119 | printk("Failed to ioremap flash\n"); | 120 | printk("Failed to ioremap flash\n"); |
121 | iounmap(ebony_small_map.virt); | ||
120 | return -EIO; | 122 | return -EIO; |
121 | } | 123 | } |
122 | 124 | ||
@@ -129,6 +131,8 @@ int __init init_ebony(void) | |||
129 | ARRAY_SIZE(ebony_large_partitions)); | 131 | ARRAY_SIZE(ebony_large_partitions)); |
130 | } else { | 132 | } else { |
131 | printk("map probe failed for flash\n"); | 133 | printk("map probe failed for flash\n"); |
134 | iounmap(ebony_small_map.virt); | ||
135 | iounmap(ebony_large_map.virt); | ||
132 | return -ENXIO; | 136 | return -ENXIO; |
133 | } | 137 | } |
134 | 138 | ||