提交 e1c9ac42 编写于 作者: J Jiri Kosina

Revert "backlight: fix memory leak on obscure error path"

This reverts commit 9ea3c498.

'data' is being allocated by devm_kzalloc(), is it's actually
wrong to free() it in the error path, as it will be destroyed
properly later.
Reported-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 d14b7a41
...@@ -228,7 +228,6 @@ static int pm860x_backlight_probe(struct platform_device *pdev) ...@@ -228,7 +228,6 @@ 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册