wifi: fix wifi panic issue
authorRongjun Chen <rongjun.chen@amlogic.com>
Thu, 14 Dec 2017 05:44:56 +0000 (13:44 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Thu, 14 Dec 2017 05:44:56 +0000 (13:44 +0800)
PD# NONE

fix if cfg is NULL, wifi will panic issue

Change-Id: I16627a2e7a62f03a656d71f85f12e198a4b2c4b0

bcmdhd.1.579.77.41.1.cn/wl_cfg80211.c

index 1a3bcb78d602f78787c55872ffe3430bb747d381..efadf25123fe3e1fc27549ddefb7751163c94371 100644 (file)
@@ -16688,9 +16688,12 @@ int wl_cfg80211_hang(struct net_device *dev, u16 reason)
 s32 wl_cfg80211_down(struct net_device *dev)
 {
        struct bcm_cfg80211 *cfg = wl_get_cfg(dev);
-       s32 err;
+       s32 err = 0;
 
        WL_DBG(("In\n"));
+       if (cfg == NULL)
+               return err;
+
        mutex_lock(&cfg->usr_sync);
 #if defined(RSSIAVG)
        wl_free_rssi_cache(&g_rssi_cache_ctrl);