lkml.org 
[lkml]   [2012]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drivers/pcmcia/electra_cf.c: add missing iounmap and kfree
Date
From: Julia Lawall <Julia.Lawall@lip6.fr>

cf and cf->mem_base have been allocated at the point of this failure, so
they should be freed before leaving the function.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
I'm not sure to understand how the call to device_init_wakeup(&ofdev->dev,
0); fits in, but there seems to be no reason why this would more
appropriate in the error case a few lines below than in the error case here.

drivers/pcmcia/electra_cf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/pcmcia/electra_cf.c b/drivers/pcmcia/electra_cf.c
index 7647d23..558d706 100644
--- a/drivers/pcmcia/electra_cf.c
+++ b/drivers/pcmcia/electra_cf.c
@@ -214,8 +214,10 @@ static int __devinit 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);



\
 
 \ /
  Last update: 2012-04-18 22:37    [W:0.031 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site