aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-04-18 10:02:02 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2015-05-30 09:14:39 -0400
commit801421eb7359f086e2b61d3125830bda7ddf5673 (patch)
treec1221f26a2665ab3b9f75b862ad221c319a5c7a8
parente632cd94723e12083ee5d0c633f37ce504a54c2b (diff)
drivers/pcmcia/electra_cf.c: add missing iounmap and kfree
cf and cf->mem_base have been allocated at the point of this failure, so they should be freed before leaving the function. [linux@dominikbrodowski.net: limit call to device_init_wakeup() to the same error paths as before] Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r--drivers/pcmcia/electra_cf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c
index 7f9950d324df..6a1bc8e8464a 100644
--- a/drivers/pcmcia/electra_cf.c
+++ b/drivers/pcmcia/electra_cf.c
@@ -216,8 +216,10 @@ static int electra_cf_probe(struct platform_device *ofdev)
216 cf->io_size = PAGE_ALIGN(resource_size(&io)); 216 cf->io_size = PAGE_ALIGN(resource_size(&io));
217 217
218 area = __get_vm_area(cf->io_size, 0, PHB_IO_BASE, PHB_IO_END); 218 area = __get_vm_area(cf->io_size, 0, PHB_IO_BASE, PHB_IO_END);
219 if (area == NULL) 219 if (area == NULL) {
220 return -ENOMEM; 220 status = -ENOMEM;
221 goto fail1;
222 }
221 223
222 cf->io_virt = (void __iomem *)(area->addr); 224 cf->io_virt = (void __iomem *)(area->addr);
223 225
@@ -320,7 +322,8 @@ fail1:
320 iounmap(cf->mem_base); 322 iounmap(cf->mem_base);
321 if (cf->gpio_base) 323 if (cf->gpio_base)
322 iounmap(cf->gpio_base); 324 iounmap(cf->gpio_base);
323 device_init_wakeup(&ofdev->dev, 0); 325 if (area)
326 device_init_wakeup(&ofdev->dev, 0);
324 kfree(cf); 327 kfree(cf);
325 return status; 328 return status;
326 329