wifi: fix wl_event_hander Duplicate creation issue [1/1]
authorRongjun Chen <rongjun.chen@amlogic.com>
Thu, 31 Aug 2017 05:49:22 +0000 (13:49 +0800)
committerRongjun Chen <rongjun.chen@amlogic.com>
Thu, 31 Aug 2017 05:49:22 +0000 (13:49 +0800)
PD#150156

Change-Id: I3c0820c6141e3a8a70df7e03af1b2b68925adbb7
wifi: fix wl_event_hander Duplicate creation issue

bcmdhd-usb.1.363.110.17.x/wl_cfg80211.c

index 0c7b24f09220268ec7b3e21cdd222856af858073..882e5d668da41024f32ae34fdc6959c46730e11b 100644 (file)
@@ -12053,12 +12053,13 @@ static void wl_deinit_priv_mem(struct bcm_cfg80211 *cfg)
 static s32 wl_create_event_handler(struct bcm_cfg80211 *cfg)
 {
        int ret = 0;
-       WL_DBG(("Enter \n"));
 
        /* Do not use DHD in cfg driver */
-       cfg->event_tsk.thr_pid = -1;
-
-       PROC_START(wl_event_handler, cfg, &cfg->event_tsk, 0, "wl_event_handler");
+       if (!cfg->event_tsk.thr_pid) {
+               WL_DBG(("Enter \n"));
+               cfg->event_tsk.thr_pid = -1;
+               PROC_START(wl_event_handler, cfg, &cfg->event_tsk, 0, "wl_event_handler");
+       }
        if (cfg->event_tsk.thr_pid < 0)
                ret = -ENOMEM;
        return ret;
@@ -12066,8 +12067,10 @@ static s32 wl_create_event_handler(struct bcm_cfg80211 *cfg)
 
 static void wl_destroy_event_handler(struct bcm_cfg80211 *cfg)
 {
-       if (cfg->event_tsk.thr_pid >= 0)
+       if (cfg->event_tsk.thr_pid >= 0) {
+               WL_DBG(("Enter \n"));
                PROC_STOP(&cfg->event_tsk);
+       }
 }
 
 void wl_terminate_event_handler(void)