]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/video/backlight/da9052_bl.c: drop devm_kfree of devm_kzalloc'd data
authorJulia Lawall <Julia.Lawall@lip6.fr>
Fri, 28 Sep 2012 00:20:19 +0000 (10:20 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 3 Oct 2012 06:50:43 +0000 (16:50 +1000)
devm_kfree should not have to be explicitly used.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,d;
@@

x = devm_kzalloc(...)
...
?-devm_kfree(d,x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/video/backlight/da9052_bl.c

index 10485c927ac65a993c58068737d029e03335a5e9..ac196181fe45a88ae45965ac7d18cb91570b1eb3 100644 (file)
@@ -129,7 +129,6 @@ static int da9052_backlight_probe(struct platform_device *pdev)
                                       &da9052_backlight_ops, &props);
        if (IS_ERR(bl)) {
                dev_err(&pdev->dev, "Failed to register backlight\n");
-               devm_kfree(&pdev->dev, wleds);
                return PTR_ERR(bl);
        }
 
@@ -149,7 +148,6 @@ static int da9052_backlight_remove(struct platform_device *pdev)
        wleds->state = DA9052_WLEDS_OFF;
        da9052_adjust_wled_brightness(wleds);
        backlight_device_unregister(bl);
-       devm_kfree(&pdev->dev, wleds);
 
        return 0;
 }