]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
wcn36xx: drain pending indicator messages on shutdown
authorDaniel Mack <daniel@zonque.org>
Wed, 23 May 2018 08:14:55 +0000 (11:14 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 25 May 2018 10:08:01 +0000 (13:08 +0300)
When the interface is shut down, wcn36xx_smd_close() potentially races
against the queue worker. Make sure to cancel the work, and then free all
the remnants in hal_ind_queue manually.

This is again just a theoretical issue, not something that was triggered in
the wild.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wcn36xx/smd.c

index ea74f2b92df50330066741a0b3ba472b9f088162..0a505b5e038b0dd540d027c77ef1d06807fb3502 100644 (file)
@@ -2513,5 +2513,11 @@ out:
 
 void wcn36xx_smd_close(struct wcn36xx *wcn)
 {
+       struct wcn36xx_hal_ind_msg *msg, *tmp;
+
+       cancel_work_sync(&wcn->hal_ind_work);
        destroy_workqueue(wcn->hal_ind_wq);
+
+       list_for_each_entry_safe(msg, tmp, &wcn->hal_ind_queue, list)
+               kfree(msg);
 }