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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z5iSYrw_7kIGA0Ae@kuha.fi.intel.com>
Date: Tue, 28 Jan 2025 10:16:34 +0200
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Benson Leung <bleung@...omium.org>
Cc: gregkh@...uxfoundation.org, abhishekpandit@...omium.org,
	dan.carpenter@...aro.org, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org, akuchynski@...gle.com,
	ukaszb@...omium.org
Subject: Re: [PATCH 2/2] usb: typec: thunderbolt: Remove IS_ERR check for plug

On Fri, Jan 24, 2025 at 07:40:38PM +0000, Benson Leung wrote:
> Fixes these Smatch static checker warnings:
> drivers/usb/typec/altmodes/thunderbolt.c:354 tbt_ready() warn: 'plug' is not an error pointer
> 
> Fixes: 100e25738659 ("usb: typec: Add driver for Thunderbolt 3 Alternate Mode")
> 
> Signed-off-by: Benson Leung <bleung@...omium.org>
> Reported-by: Dan Carpenter <dan.carpenter@...aro.org>

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

> ---
>  drivers/usb/typec/altmodes/thunderbolt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/altmodes/thunderbolt.c b/drivers/usb/typec/altmodes/thunderbolt.c
> index 94e47d30e598..6eadf7835f8f 100644
> --- a/drivers/usb/typec/altmodes/thunderbolt.c
> +++ b/drivers/usb/typec/altmodes/thunderbolt.c
> @@ -351,10 +351,10 @@ static bool tbt_ready(struct typec_altmode *alt)
>  	 */
>  	for (int i = 0; i < TYPEC_PLUG_SOP_PP + 1; i++) {
>  		plug = typec_altmode_get_plug(tbt->alt, i);
> -		if (IS_ERR(plug))
> +		if (!plug)
>  			continue;
>  
> -		if (!plug || plug->svid != USB_TYPEC_TBT_SID)
> +		if (plug->svid != USB_TYPEC_TBT_SID)
>  			break;
>  
>  		plug->desc = "Thunderbolt3";
> -- 
> 2.48.1.262.g85cc9f2d1e-goog

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ