net: wireless: bcmdhd: Always turn Off wlan power on interface down
authorDmitry Shmidt <dimitrysh@google.com>
Mon, 5 Mar 2012 18:17:06 +0000 (10:17 -0800)
committerDmitry Shmidt <dimitrysh@google.com>
Wed, 14 Mar 2012 23:35:51 +0000 (16:35 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcmdhd/dhd_linux.c

index 9654719e428716cc6f706178fa5892607a5450f7..9e1071f22375d7e8d8dea204199c866ee372cb05 100644 (file)
@@ -2271,7 +2271,7 @@ dhd_cleanup_virt_ifaces(dhd_info_t *dhd)
 static int
 dhd_stop(struct net_device *net)
 {
-       int ifidx;
+       int ifidx = 0;
        dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(net);
        DHD_OS_WAKE_LOCK(&dhd->pub);
        DHD_TRACE(("%s: Enter %p\n", __FUNCTION__, net));
@@ -2305,14 +2305,15 @@ dhd_stop(struct net_device *net)
        /* Stop the protocol module */
        dhd_prot_stop(&dhd->pub);
 
+       OLD_MOD_DEC_USE_COUNT;
+exit:
 #if defined(WL_CFG80211)
        if (ifidx == 0 && !dhd_download_fw_on_driverload)
                wl_android_wifi_off(net);
 #endif
        dhd->pub.rxcnt_timeout = 0;
        dhd->pub.txcnt_timeout = 0;
-       OLD_MOD_DEC_USE_COUNT;
-exit:
+
        DHD_OS_WAKE_UNLOCK(&dhd->pub);
        return 0;
 }