diff mbox

mfd: ab8500-core: Fix invalid free of devm_ allocated data

Message ID 1353673123-32340-1-git-send-email-tushar.behera@linaro.org
State Accepted
Commit 4e1328be4d4e4967d54bf7ae3b0805ec53fc4f91
Headers show

Commit Message

Tushar Behera Nov. 23, 2012, 12:18 p.m. UTC
The objects allocated by devm_* APIs are managed by devres and are
freed when the device is detached. Hence there is no need to remove
them explicitly in remove function.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
 drivers/mfd/ab8500-core.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

Comments

Linus Walleij Nov. 28, 2012, 3:48 p.m. UTC | #1
On Fri, Nov 23, 2012 at 1:18 PM, Tushar Behera <tushar.behera@linaro.org> wrote:

> The objects allocated by devm_* APIs are managed by devres and are
> freed when the device is detached. Hence there is no need to remove
> them explicitly in remove function.
>
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>

Looks good to me.
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Samuel Ortiz Nov. 30, 2012, 10:52 a.m. UTC | #2
Hi Tushar,

On Fri, Nov 23, 2012 at 05:48:43PM +0530, Tushar Behera wrote:
> The objects allocated by devm_* APIs are managed by devres and are
> freed when the device is detached. Hence there is no need to remove
> them explicitly in remove function.
> 
> Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
> ---
>  drivers/mfd/ab8500-core.c |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)
Applied, thanks.

Cheers,
Samuel.
diff mbox

Patch

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 148d2ee..af7a6ba 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1428,11 +1428,6 @@  static int __devexit ab8500_remove(struct platform_device *pdev)
 		sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group);
 
 	mfd_remove_devices(ab8500->dev);
-	free_irq(ab8500->irq, ab8500);
-
-	kfree(ab8500->oldmask);
-	kfree(ab8500->mask);
-	kfree(ab8500);
 
 	return 0;
 }