From: Vladimir Zapolskiy Date: Sun, 14 Jun 2015 14:32:14 +0000 (+0300) Subject: backlight: pwm_bl: Free PWM requested by legacy API on error path X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=60d613d6aef4ae49988eeb3ad38af948c561db1e;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Lee Jones --- 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; }