diff options
Diffstat (limited to 'drivers/mtd/nand/ppchameleonevb.c')
-rw-r--r-- | drivers/mtd/nand/ppchameleonevb.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mtd/nand/ppchameleonevb.c b/drivers/mtd/nand/ppchameleonevb.c index 22fa65c12ab9..eb7d4d443deb 100644 --- a/drivers/mtd/nand/ppchameleonevb.c +++ b/drivers/mtd/nand/ppchameleonevb.c | |||
@@ -276,6 +276,7 @@ static int __init ppchameleonevb_init(void) | |||
276 | /* Scan to find existence of the device (it could not be mounted) */ | 276 | /* Scan to find existence of the device (it could not be mounted) */ |
277 | if (nand_scan(ppchameleon_mtd, 1)) { | 277 | if (nand_scan(ppchameleon_mtd, 1)) { |
278 | iounmap((void *)ppchameleon_fio_base); | 278 | iounmap((void *)ppchameleon_fio_base); |
279 | ppchameleon_fio_base = NULL; | ||
279 | kfree(ppchameleon_mtd); | 280 | kfree(ppchameleon_mtd); |
280 | goto nand_evb_init; | 281 | goto nand_evb_init; |
281 | } | 282 | } |
@@ -314,6 +315,8 @@ static int __init ppchameleonevb_init(void) | |||
314 | ppchameleonevb_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL); | 315 | ppchameleonevb_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL); |
315 | if (!ppchameleonevb_mtd) { | 316 | if (!ppchameleonevb_mtd) { |
316 | printk("Unable to allocate PPChameleonEVB NAND MTD device structure.\n"); | 317 | printk("Unable to allocate PPChameleonEVB NAND MTD device structure.\n"); |
318 | if (ppchameleon_fio_base) | ||
319 | iounmap(ppchameleon_fio_base); | ||
317 | return -ENOMEM; | 320 | return -ENOMEM; |
318 | } | 321 | } |
319 | 322 | ||
@@ -322,6 +325,8 @@ static int __init ppchameleonevb_init(void) | |||
322 | if (!ppchameleonevb_fio_base) { | 325 | if (!ppchameleonevb_fio_base) { |
323 | printk("ioremap PPChameleonEVB NAND flash failed\n"); | 326 | printk("ioremap PPChameleonEVB NAND flash failed\n"); |
324 | kfree(ppchameleonevb_mtd); | 327 | kfree(ppchameleonevb_mtd); |
328 | if (ppchameleon_fio_base) | ||
329 | iounmap(ppchameleon_fio_base); | ||
325 | return -EIO; | 330 | return -EIO; |
326 | } | 331 | } |
327 | 332 | ||
@@ -378,6 +383,8 @@ static int __init ppchameleonevb_init(void) | |||
378 | if (nand_scan(ppchameleonevb_mtd, 1)) { | 383 | if (nand_scan(ppchameleonevb_mtd, 1)) { |
379 | iounmap((void *)ppchameleonevb_fio_base); | 384 | iounmap((void *)ppchameleonevb_fio_base); |
380 | kfree(ppchameleonevb_mtd); | 385 | kfree(ppchameleonevb_mtd); |
386 | if (ppchameleon_fio_base) | ||
387 | iounmap(ppchameleon_fio_base); | ||
381 | return -ENXIO; | 388 | return -ENXIO; |
382 | } | 389 | } |
383 | #ifdef CONFIG_MTD_PARTITIONS | 390 | #ifdef CONFIG_MTD_PARTITIONS |