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-Tag: v5.15~14413^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60d613d6aef4ae49988eeb3ad38af948c561db1e;p=platform%2Fkernel%2Flinux-starfive.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 a22c1ec..64f9e1b 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; }