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: <fde57cbf-4367-4741-8d67-b569ecb9dc61@oss.qualcomm.com>
Date: Thu, 26 Jun 2025 11:53:05 +0530
From: Prashanth K <prashanth.k@....qualcomm.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Lianqin Hu <hulianqin@...o.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
        Jeff Johnson <jeff.johnson@....qualcomm.com>,
        Michael Walle <mwalle@...nel.org>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: u_serial: remove some dead code



On 6/25/2025 8:51 PM, Dan Carpenter wrote:
> There is no need to check if "port" is NULL.  We already verified that it
> is non-NULL.  It's a stack variable and can't be modified by a different
> thread.  Delete this dead code.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---

Perhaps you could add Closes and Fixes tag, but its up to you.

Reviewed-by: Prashanth K <prashanth.k@....qualcomm.com>

>  drivers/usb/gadget/function/u_serial.c | 7 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c
> index ab544f6824be..96756a489d6a 100644
> --- a/drivers/usb/gadget/function/u_serial.c
> +++ b/drivers/usb/gadget/function/u_serial.c
> @@ -1501,13 +1501,7 @@ void gserial_suspend(struct gserial *gser)
>  		spin_unlock_irqrestore(&serial_port_lock, flags);
>  		if (!gserial_wakeup_host(gser))
>  			return;
> -
> -		/* Check if port is valid after acquiring lock back */
>  		spin_lock_irqsave(&serial_port_lock, flags);
> -		if (!port) {
> -			spin_unlock_irqrestore(&serial_port_lock, flags);
> -			return;
> -		}
>  	}
>  
>  	spin_lock(&port->port_lock);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ