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:   Tue, 5 Jun 2018 11:06:06 +0200
From:   Thierry Reding <thierry.reding@...il.com>
To:     gengdongjiu <gengdongjiu@...wei.com>
Cc:     Greg KH <gregkh@...uxfoundation.org>, mathias.nyman@...el.com,
        jonathanh@...dia.com, linux-usb@...r.kernel.org,
        linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: xhci: remove the code build warning

On Tue, Jun 05, 2018 at 04:54:17PM +0800, gengdongjiu wrote:
> 
> 
> On 2018/6/5 16:40, Greg KH wrote:
> > On Wed, Jun 06, 2018 at 12:35:00AM +0800, Dongjiu Geng wrote:
> >> Initialize the 'err' variate to remove the build warning,
> >> the warning is shown as below:
> >>
> >> drivers/usb/host/xhci-tegra.c: In function ‘tegra_xusb_mbox_thread’:
> >> drivers/usb/host/xhci-tegra.c:552:6: warning: ‘err’ may be used uninitialized in this function [-Wuninitialized]
> >> drivers/usb/host/xhci-tegra.c:482:6: note: ‘err’ was declared here
> >>
> >> Signed-off-by: Dongjiu Geng <gengdongjiu@...wei.com>
> >> ---
> > 
> > Any hint as to what commit caused this warning to show up?
> 
> It seems below commit:
> 
> commit e84fce0f8837496a48d11086829bdbe170358b7a
> Author: Thierry Reding <treding@...dia.com>
> Date:   Thu Feb 11 18:10:48 2016 +0100
> 
>     usb: xhci: Add NVIDIA Tegra XUSB controller driver
> 
>     Add support for the on-chip XUSB controller present on Tegra SoCs. This
>     controller, when loaded with external firmware, exposes an interface
>     compliant with xHCI. This driver loads the firmware, starts the
>     controller, and is able to service host-specific messages sent by the
>     controller's firmware.
> 
>     The controller also supports USB device mode as well as powergating
>     of the SuperSpeed and host-controller logic when not in use, but
>     support for these is not yet implemented.
> 
>     Based on work by:
>       Ajay Gupta <ajayg@...dia.com>
>       Bharath Yadav <byadav@...dia.com>
>       Andrew Bresticker <abrestic@...omium.org>
> 
>     Cc: Mathias Nyman <mathias.nyman@...el.com>
>     Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
>     Acked-by: Mathias Nyman <mathias.nyman@...ux.intel.com>
>     Signed-off-by: Thierry Reding <treding@...dia.com>

I've never seen this warning before. It's also a false positive in that
technically the mailbox message will always have at least one bit set in
"mask". However, I don't see how the compiler could know about it, given
that the data comes from an external source, so I think this makes sense
as a hint to the compiler. So:

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

Can you provide more detail on what exact version of which compiler you
used that triggered this? I wonder why it's never presented itself with
the compiler that I use.

Thierry

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ