mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 08:26:59 +00:00
backlight: fix memory leak on obscure error path
Dredged out of bugzilla Reported-by: Martlin Ettl <ettl.martin@gmx.de> Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=15492 Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
59f91e5dd0
commit
9ea3c49896
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue