qcacld-3.0: Hold peer reference when handling unmap_timer_work

There is race when unamp_timer_work and peer is deleted. Hold the
reference to peer while handling the peer_unmap_timer_work.

Change-Id: Ie6cef3f13e55ab7d2310f0fff4254cde3e3c96e1
CRs-Fixed: 2381036
This commit is contained in:
Manjunathappa Prakash 2019-01-15 22:07:54 -08:00 • committed by nshrivas
commit 8b68663ddc

View file

@ -1553,6 +1553,7 @@ static void ol_txrx_pdev_detach(struct cdp_pdev *ppdev, int force)
htt_pdev_free(pdev->htt_pdev);
ol_txrx_peer_find_detach(pdev);
qdf_flush_work(&pdev->peer_unmap_timer_work);
ol_txrx_tso_stats_deinit(pdev);
ol_txrx_fw_stats_desc_pool_deinit(pdev);
@ -3192,6 +3193,7 @@ void peer_unmap_timer_work_function(void *param)
WMA_LOGI("Enter: %s", __func__);
/* Added for debugging only */
ol_txrx_dump_peer_access_list(param);
ol_txrx_peer_release_ref(param, PEER_DEBUG_ID_OL_UNMAP_TIMER_WORK);
wlan_roam_debug_dump_table();
cds_trigger_recovery(QDF_PEER_UNMAP_TIMEDOUT);
}
@ -3218,6 +3220,8 @@ void peer_unmap_timer_handler(void *data)
qdf_create_work(0, &txrx_pdev->peer_unmap_timer_work,
peer_unmap_timer_work_function,
peer);
/* Make sure peer is present before scheduling work */
ol_txrx_peer_get_ref(peer, PEER_DEBUG_ID_OL_UNMAP_TIMER_WORK);
qdf_sched_work(0, &txrx_pdev->peer_unmap_timer_work);
} else {
ol_txrx_err("Recovery is in progress, ignore!");