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:
Martlin Ettl 2012-07-05 17:58:46 +01:00 committed by Jiri Kosina
parent 59f91e5dd0
commit 9ea3c49896

View File

@ -228,6 +228,7 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
data->port = pdata->flags;
if (data->port < 0) {
dev_err(&pdev->dev, "wrong platform data is assigned");
kfree(data);
return -EINVAL;
}