瀏覽代碼

qcacmn: Avoid calling qdf_timer_mod after qdf_timer_stop

Avoid calling qdf_timer_mod after qdf_timer_stop as the
node is deleted after timer is stopped and qdf_timer_mod
dereferences the deleted node leading to data abort.

Replace 'qdf_timer_mod' by the sequence
'qdf_timer_sync_cancel, qdf_timer_start' to be SMP safe.
If a timer is being started for the first time, use only
'qdf_timer_start' and not the sequence
'qdf_timer_sync_cancel, qdf_timer_start'

Change-Id: Ida5440d4a54d49aa97f57fbda57ab1ef2cce16e6
CRs-Fixed: 3005699
Gururaj Pandurangi 3 年之前
父節點
當前提交
f5673aa2a4
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 3 3
      umac/dfs/core/src/misc/dfs_nol.c
  2. 2 2
      umac/dfs/core/src/misc/dfs_process_radar_found_ind.c

+ 3 - 3
umac/dfs/core/src/misc/dfs_nol.c

@@ -371,8 +371,8 @@ void dfs_nol_addchan(struct wlan_dfs *dfs,
 				"Update OS Ticks for NOL %d MHz / %d MHz",
 				 nol->nol_freq, nol->nol_chwidth);
 
-			qdf_timer_stop(&nol->nol_timer);
-			qdf_timer_mod(&nol->nol_timer,
+			qdf_timer_sync_cancel(&nol->nol_timer);
+			qdf_timer_start(&nol->nol_timer,
 					dfs_nol_timeout * TIME_IN_MS);
 			return;
 		}
@@ -403,7 +403,7 @@ void dfs_nol_addchan(struct wlan_dfs *dfs,
 		       &elem->nol_timer, dfs_remove_from_nol,
 		       elem, QDF_TIMER_TYPE_WAKE_APPS);
 
-	qdf_timer_mod(&elem->nol_timer, dfs_nol_timeout * TIME_IN_MS);
+	qdf_timer_start(&elem->nol_timer, dfs_nol_timeout * TIME_IN_MS);
 
 	/* Update the NOL counter. */
 	dfs->dfs_nol_count++;

+ 2 - 2
umac/dfs/core/src/misc/dfs_process_radar_found_ind.c

@@ -758,11 +758,11 @@ bool dfs_radar_found_event_basic_sanity(struct wlan_dfs *dfs,
 
 void dfs_send_csa_to_current_chan(struct wlan_dfs *dfs)
 {
-	qdf_timer_stop(&dfs->wlan_dfstesttimer);
 	dfs->wlan_dfstest = 1;
 	dfs->wlan_dfstest_ieeechan = dfs->dfs_curchan->dfs_ch_ieee;
 	dfs->wlan_dfstesttime = 1;   /* 1ms */
-	qdf_timer_mod(&dfs->wlan_dfstesttimer, dfs->wlan_dfstesttime);
+	qdf_timer_sync_cancel(&dfs->wlan_dfstesttimer);
+	qdf_timer_start(&dfs->wlan_dfstesttimer, dfs->wlan_dfstesttime);
 }
 
 int dfs_second_segment_radar_disable(struct wlan_dfs *dfs)