Search Linux Wireless

Re: [PATCH] brcmfmac: fix uninitialized warning in brcmf_usb_probe_phase2()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Arend,

On Fri, Jun 16, 2017 at 6:36 PM, Arend van Spriel
<arend.vanspriel@xxxxxxxxxxxx> wrote:
> This fixes the following warning:
>
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c: In function
>   'brcmf_usb_probe_phase2':
>   drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c:1198:2:
>   warning: 'devinfo' may be used uninitialized in this function
>   [-Wmaybe-uninitialized]
>     mutex_unlock(&devinfo->dev_init_lock);
>
> Fixes: 6d0507a777fb ("brcmfmac: add parameter to pass error code in firmware callback")
> Cc: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
> Reported-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
> Signed-off-by: Arend van Spriel <arend.vanspriel@xxxxxxxxxxxx>
> ---
>  drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> index 9ce3b55..8b16387 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
> @@ -1164,14 +1164,13 @@ static void brcmf_usb_probe_phase2(struct device *dev, int ret,
>                                    void *nvram, u32 nvlen)
>  {
>         struct brcmf_bus *bus = dev_get_drvdata(dev);
> -       struct brcmf_usbdev_info *devinfo;
> +       struct brcmf_usbdev_info *devinfo = bus->bus_priv.usb->devinfo;;
>
>         if (ret)
>                 goto error;

Completely unrelated to this specific patch, I just want to point out
that this construct looks _really_ weird.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@xxxxxxxxx
Profile: http://www.google.com/profiles/julian.calaby/



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux