Skip to content

Commit

Permalink
drivers/video/backlight/da9052_bl.c: drop devm_kfree of devm_kzalloc'…
Browse files Browse the repository at this point in the history
…d data

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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Julia Lawall authored and Linus Torvalds committed Oct 5, 2012
1 parent 56a2aba commit 66be0e5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/video/backlight/da9052_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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;
}
Expand Down

0 comments on commit 66be0e5

Please sign in to comment.