From 7cf700a71d3a5c723e8deeb10b04f691721e34bd Mon Sep 17 00:00:00 2001 From: Dundi Raviteja Date: Mon, 8 Aug 2022 11:11:29 +0530 Subject: [PATCH] qcacld-3.0: Reinitialize mon_register_event before wait_for_completion Reinitialize mon_register_event before wait_for_completion to make sure that it waits for fresh completion. "done" variable in struct completion increments in complete() API and decrements in wait_for_completion() API. In wait_for_completion() API, if "done" value is 0 then it will wait for the completion else it will continue without waiting. If reinitialization is not done, there is a possibility that wait_for_completion() may continue without waiting. Change-Id: I780103f551938438f27a11b006cc7c3e6edc6820 CRs-Fixed: 3251876 --- components/pkt_capture/core/src/wlan_pkt_capture_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/pkt_capture/core/src/wlan_pkt_capture_main.c b/components/pkt_capture/core/src/wlan_pkt_capture_main.c index 5d1e3ee2b7d8..72b08322e3fc 100644 --- a/components/pkt_capture/core/src/wlan_pkt_capture_main.c +++ b/components/pkt_capture/core/src/wlan_pkt_capture_main.c @@ -823,6 +823,7 @@ QDF_STATUS pkt_capture_deregister_callbacks(struct wlan_objmgr_vdev *vdev) &vdev_priv->mon_ctx->mon_event_flag); set_bit(PKT_CAPTURE_RX_POST_EVENT, &vdev_priv->mon_ctx->mon_event_flag); + reinit_completion(&vdev_priv->mon_ctx->mon_register_event); wake_up_interruptible(&vdev_priv->mon_ctx->mon_wait_queue); /*