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]
Date:   Thu, 30 Dec 2021 08:02:00 +0100
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     cgel.zte@...il.com
Cc:     Mathias Nyman <mathias.nyman@...el.com>, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, luo penghao <luo.penghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux] usb: xhci-ring: Add return if ret is less than 0

On Thu, Dec 30, 2021 at 06:40:10AM +0000, cgel.zte@...il.com wrote:
> From: luo penghao <luo.penghao@....com.cn>
> 
> For the robustness of the code, judgment and return should be added here

I do not understand this changelog text at all.  Please explain the
problem and why you are making this change much better.

> 
> The clang_analyzer complains as follows:
> 
> drivers/usb/host/xhci-ring.c:
> 
> Value stored to 'ret' is never read
> 
> Reported-by: Zeal Robot <zealci@....com.cn>
> Signed-off-by: luo penghao <luo.penghao@....com.cn>
> ---
>  drivers/usb/host/xhci-ring.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
> index d0b6806..c4eefe2 100644
> --- a/drivers/usb/host/xhci-ring.c
> +++ b/drivers/usb/host/xhci-ring.c
> @@ -3721,6 +3721,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
>  		ret = prepare_transfer(xhci, xhci->devs[slot_id],
>  				       ep_index, urb->stream_id,
>  				       1, urb, 1, mem_flags);
> +		if (unlikely(ret < 0))
> +			return ret;
>  		urb_priv->td[1].last_trb = ring->enqueue;
>  		urb_priv->td[1].last_trb_seg = ring->enq_seg;
>  		field = TRB_TYPE(TRB_NORMAL) | ring->cycle_state | TRB_IOC;
> -- 
> 2.15.2
> 
> 

How did you test this change?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ