Skip to content

Commit 9a6c755

Browse files
krish2718rlubos
authored andcommitted
drivers: wifi: Fix mutex re-initialization
The mutex is used to protect RPU zephyr context which gets modified for every interface down and up (including recovery), so, it was being re-initialized but also used to protect down and up which is a bug. Move the re-initialization to the driver entry so that it happens only once and we can properly use the mutext for down and up protection. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
1 parent 09884d8 commit 9a6c755

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/wifi/nrf700x/src/fmac_main.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,6 @@ enum nrf_wifi_status nrf_wifi_fmac_dev_add_zep(struct nrf_wifi_drv_priv_zep *drv
632632
goto err;
633633
}
634634

635-
k_mutex_init(&rpu_ctx_zep->rpu_lock);
636-
637635
return status;
638636
err:
639637
if (rpu_ctx) {
@@ -782,6 +780,7 @@ static int nrf_wifi_drv_main_zep(const struct device *dev)
782780
nrf_wifi_scan_timeout_work);
783781
#endif /* CONFIG_NRF700X_RADIO_TEST */
784782

783+
k_mutex_init(&rpu_drv_priv_zep.rpu_ctx_zep.rpu_lock);
785784
return 0;
786785
#ifdef CONFIG_NRF700X_RADIO_TEST
787786
fmac_deinit:

0 commit comments

Comments
 (0)