فهرست منبع

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>
Vladimir Zapolskiy 10 سال پیش
والد
کامیت
60d613d6ae
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      drivers/video/backlight/pwm_bl.c

+ 2 - 0
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;
 	}