1
0
Fork 0

backlight: pwm_bl: Free PWM requested by legacy API on error path

If pwm is requested by legacy pwm_request() and if the following
backlight_device_register() call fails, add pwm_free() clean-up.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
hifive-unleashed-5.1
Vladimir Zapolskiy 2015-06-14 17:32:14 +03:00 committed by Lee Jones
parent 02f22c004f
commit 60d613d6ae
1 changed files with 2 additions and 0 deletions

View File

@ -328,6 +328,8 @@ static int pwm_backlight_probe(struct platform_device *pdev)
if (IS_ERR(bl)) {
dev_err(&pdev->dev, "failed to register backlight\n");
ret = PTR_ERR(bl);
if (pb->legacy)
pwm_free(pb->pwm);
goto err_alloc;
}