Skip to content

Commit 66be0e5

Browse files
JuliaLawalltorvalds
authored andcommitted
drivers/video/backlight/da9052_bl.c: drop devm_kfree of devm_kzalloc'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 <[email protected]> Acked-by: Jingoo Han <[email protected]> Signed-off-by: Florian Tobias Schandinat <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 56a2aba commit 66be0e5

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

Diff for: drivers/video/backlight/da9052_bl.c

-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ static int da9052_backlight_probe(struct platform_device *pdev)
129129
&da9052_backlight_ops, &props);
130130
if (IS_ERR(bl)) {
131131
dev_err(&pdev->dev, "Failed to register backlight\n");
132-
devm_kfree(&pdev->dev, wleds);
133132
return PTR_ERR(bl);
134133
}
135134

@@ -149,7 +148,6 @@ static int da9052_backlight_remove(struct platform_device *pdev)
149148
wleds->state = DA9052_WLEDS_OFF;
150149
da9052_adjust_wled_brightness(wleds);
151150
backlight_device_unregister(bl);
152-
devm_kfree(&pdev->dev, wleds);
153151

154152
return 0;
155153
}

0 commit comments

Comments
 (0)