backlight: 88pm860x_bl - potential memory leak
I added a kfree() on the error path. I don't really expect it to affect anyone, but it's easy and makes the static checkers happy. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
8193db2291
commit
9844ce0501
@@ -222,6 +222,7 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
|
|||||||
data->port = __check_device(pdata, name);
|
data->port = __check_device(pdata, name);
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user