brcmfmac: fix uninitialized warning in brcmf_usb_probe_phase2()
authorArend Van Spriel <arend.vanspriel@broadcom.com>
Fri, 16 Jun 2017 08:36:35 +0000 (09:36 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 16 Jun 2017 08:52:36 +0000 (11:52 +0300)
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@canb.auug.org.au>
Reported-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c

index 9ce3b55c3ffe49398dde6417b2d42da8f7ce1ff9..0eea48e73331d57297099266b1725df2be35a565 100644 (file)
@@ -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;
 
        brcmf_dbg(USB, "Start fw downloading\n");
 
-       devinfo = bus->bus_priv.usb->devinfo;
        ret = check_file(fw->data);
        if (ret < 0) {
                brcmf_err("invalid firmware\n");