On Sun, 14 Jun 2015, Vladimir Zapolskiy wrote:
> 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 <[email protected]>
> ---
> drivers/video/backlight/pwm_bl.c | 2 ++
> 1 file changed, 2 insertions(+)
Applied, thanks.
> diff --git a/drivers/video/backlight/pwm_bl.c
> b/drivers/video/backlight/pwm_bl.c
> index 9991cdb..a691247 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -307,6 +307,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;
> }
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-pwm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html