diff options
author | Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> | 2015-06-14 17:32:14 +0300 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2016-01-11 10:45:24 +0000 |
commit | 60d613d6aef4ae49988eeb3ad38af948c561db1e (patch) | |
tree | 83a079993be7b6f9ddc195afade1d9eae3153036 | |
parent | 02f22c004ff2ab0ce1f2fa3cc6a87cf20a4fed40 (diff) | |
download | linux-60d613d6aef4ae49988eeb3ad38af948c561db1e.tar.bz2 |
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>
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index a22c1ec29de7..64f9e1b8655f 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -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; } |