Commit 801421eb authored by Julia Lawall's avatar Julia Lawall Committed by Dominik Brodowski

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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
parent e632cd94
...@@ -216,8 +216,10 @@ static int electra_cf_probe(struct platform_device *ofdev) ...@@ -216,8 +216,10 @@ static int electra_cf_probe(struct platform_device *ofdev)
cf->io_size = PAGE_ALIGN(resource_size(&io)); cf->io_size = PAGE_ALIGN(resource_size(&io));
area = __get_vm_area(cf->io_size, 0, PHB_IO_BASE, PHB_IO_END); area = __get_vm_area(cf->io_size, 0, PHB_IO_BASE, PHB_IO_END);
if (area == NULL) if (area == NULL) {
return -ENOMEM; status = -ENOMEM;
goto fail1;
}
cf->io_virt = (void __iomem *)(area->addr); cf->io_virt = (void __iomem *)(area->addr);
...@@ -320,7 +322,8 @@ static int electra_cf_probe(struct platform_device *ofdev) ...@@ -320,7 +322,8 @@ static int electra_cf_probe(struct platform_device *ofdev)
iounmap(cf->mem_base); iounmap(cf->mem_base);
if (cf->gpio_base) if (cf->gpio_base)
iounmap(cf->gpio_base); iounmap(cf->gpio_base);
device_init_wakeup(&ofdev->dev, 0); if (area)
device_init_wakeup(&ofdev->dev, 0);
kfree(cf); kfree(cf);
return status; return status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment