summaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2012-04-18 16:02:02 +0200
committerDominik Brodowski <linux@dominikbrodowski.net>2015-05-30 15:14:39 +0200
commit801421eb7359f086e2b61d3125830bda7ddf5673 (patch)
treec1221f26a2665ab3b9f75b862ad221c319a5c7a8 /drivers/pcmcia
parente632cd94723e12083ee5d0c633f37ce504a54c2b (diff)
downloadlinux-801421eb7359f086e2b61d3125830bda7ddf5673.tar.bz2
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>
Diffstat (limited to 'drivers/pcmcia')
-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)
cf->io_size = PAGE_ALIGN(resource_size(&io));
area = __get_vm_area(cf->io_size, 0, PHB_IO_BASE, PHB_IO_END);
- if (area == NULL)
- return -ENOMEM;
+ if (area == NULL) {
+ status = -ENOMEM;
+ goto fail1;
+ }
cf->io_virt = (void __iomem *)(area->addr);
@@ -320,7 +322,8 @@ fail1:
iounmap(cf->mem_base);
if (cf->gpio_base)
iounmap(cf->gpio_base);
- device_init_wakeup(&ofdev->dev, 0);
+ if (area)
+ device_init_wakeup(&ofdev->dev, 0);
kfree(cf);
return status;