Commit 9ea3c498 authored by Martlin Ettl's avatar Martlin Ettl Committed by Jiri Kosina

backlight: fix memory leak on obscure error path

Dredged out of bugzilla
Reported-by: default avatarMartlin Ettl <ettl.martin@gmx.de>
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=15492Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 59f91e5d
...@@ -228,6 +228,7 @@ static int pm860x_backlight_probe(struct platform_device *pdev) ...@@ -228,6 +228,7 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
data->port = pdata->flags; data->port = pdata->flags;
if (data->port < 0) { if (data->port < 0) {
dev_err(&pdev->dev, "wrong platform data is assigned"); dev_err(&pdev->dev, "wrong platform data is assigned");
kfree(data);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment