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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZXMgntTKDPfAQbYT@kuha.fi.intel.com>
Date:   Fri, 8 Dec 2023 15:56:46 +0200
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Johan Hovold <johan+linaro@...nel.org>
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: typec: ucsi: fix gpio-based orientation detection

On Fri, Dec 08, 2023 at 01:36:02PM +0100, Johan Hovold wrote:
> Fix the recently added connector sanity check which was off by one and
> prevented orientation notifications from being handled correctly for the
> second port when using GPIOs to determine orientation.
> 
> Fixes: c6165ed2f425 ("usb: ucsi: glink: use the connector orientation GPIO to provide switch events")
> Cc: Neil Armstrong <neil.armstrong@...aro.org>
> Signed-off-by: Johan Hovold <johan+linaro@...nel.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>

> ---
> 
> I found this one through inspection when skimming the driver.
> 
> Johan
> 
> 
>  drivers/usb/typec/ucsi/ucsi_glink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
> index db6e248f8208..4853141cd10c 100644
> --- a/drivers/usb/typec/ucsi/ucsi_glink.c
> +++ b/drivers/usb/typec/ucsi/ucsi_glink.c
> @@ -228,7 +228,7 @@ static void pmic_glink_ucsi_notify(struct work_struct *work)
>  
>  	con_num = UCSI_CCI_CONNECTOR(cci);
>  	if (con_num) {
> -		if (con_num < PMIC_GLINK_MAX_PORTS &&
> +		if (con_num <= PMIC_GLINK_MAX_PORTS &&
>  		    ucsi->port_orientation[con_num - 1]) {
>  			int orientation = gpiod_get_value(ucsi->port_orientation[con_num - 1]);
>  
> -- 
> 2.41.0

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ