brcmfmac: start netif queues only when setup is completed successful
authorArend van Spriel <arend@broadcom.com>
Fri, 29 Nov 2013 10:48:16 +0000 (11:48 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 2 Dec 2013 19:25:17 +0000 (14:25 -0500)
Moving the call to netif_start_queue() after brcmf_cfg80211_up() is
completed successful. If not return -EIO instead of -1 as that results
in 'Operation not permitted' which can put user on wrong track.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c

index ab207e22e51513036c90ff1eeb804f49e5635dec..f4eeaa1b7319c778d21bdd6067e12a691063eb6d 100644 (file)
@@ -769,7 +769,6 @@ static int brcmf_netdev_open(struct net_device *ndev)
        struct brcmf_pub *drvr = ifp->drvr;
        struct brcmf_bus *bus_if = drvr->bus_if;
        u32 toe_ol;
-       s32 ret = 0;
 
        brcmf_dbg(TRACE, "Enter, idx=%d\n", ifp->bssidx);
 
@@ -788,14 +787,14 @@ static int brcmf_netdev_open(struct net_device *ndev)
        else
                ndev->features &= ~NETIF_F_IP_CSUM;
 
-       /* Allow transmit calls */
-       netif_start_queue(ndev);
        if (brcmf_cfg80211_up(ndev)) {
                brcmf_err("failed to bring up cfg80211\n");
-               return -1;
+               return -EIO;
        }
 
-       return ret;
+       /* Allow transmit calls */
+       netif_start_queue(ndev);
+       return 0;
 }
 
 static const struct net_device_ops brcmf_netdev_ops_pri = {