lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140820073234.GI13793@ulmo>
Date:	Wed, 20 Aug 2014 09:32:35 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Lothar Waßmann <LW@...O-electronics.de>
Cc:	Bryan Wu <cooloney@...il.com>,
	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	Jingoo Han <jg1.han@...sung.com>,
	Lee Jones <lee.jones@...aro.org>,
	Tomi Valkeinen <tomi.valkeinen@...com>,
	linux-fbdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-pwm@...r.kernel.org
Subject: Re: [PATCH] pwm-backlight: fix bogus request for GPIO#0 when
 instantiated from DT

On Wed, Aug 20, 2014 at 08:38:36AM +0200, Lothar Waßmann wrote:
> commit 257462dbf3ed ("pwm-backlight: switch to gpiod interface")
> introduced a regression leading to acquiring a bogus GPIO-0 when
> configured from DT without an 'enable-gpios' property.
> The driver will happily accept the 0 initialized 'enable_gpio' member
> of the struct platform_pwm_backlight_data as valid gpio number, and
> request this GPIO as enable pin. In case of multiple driver instances,
> the second will fail to register with the error message:
> pwm-backlight backlight1.23: failed to request GPIO#0: -16
> 
> Fix this by setting enable_gpio in the pdata struct to -EINVAL.
> 
> Signed-off-by: Lothar Waßmann <LW@...O-electronics.de>
> ---
>  drivers/video/backlight/pwm_bl.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index d7a3d13..e6ef6b4 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -172,7 +172,7 @@ static int pwm_backlight_parse_dt(struct device *dev,
>  		data->dft_brightness = value;
>  		data->max_brightness--;
>  	}
> -
> +	data->enable_gpio = -EINVAL;

I'd prefer to keep the blank line for readability. Other than that:

Acked-by: Thierry Reding <treding@...dia.com>

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ