]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
mt76x2: init: disable all pending tasklets during device removal
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Tue, 23 Jan 2018 09:03:24 +0000 (10:03 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 24 Jan 2018 15:17:35 +0000 (17:17 +0200)
There is a possible race in mt76x2_stop_hardware() since pre_tbtt and
dfs tasklets could run during driver cleanup. Fix it disabling all
pending tasklets during device removal

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Acked-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/mediatek/mt76/mt76x2_init.c

index 9f20a308ff769fc7f54fc128622f4747a1cead84..7b4851481dd6d6c3f1326eb95a7fb6d47b66357d 100644 (file)
@@ -614,6 +614,8 @@ void mt76x2_stop_hardware(struct mt76x2_dev *dev)
 
 void mt76x2_cleanup(struct mt76x2_dev *dev)
 {
+       tasklet_disable(&dev->dfs_pd.dfs_tasklet);
+       tasklet_disable(&dev->pre_tbtt_tasklet);
        mt76x2_stop_hardware(dev);
        mt76x2_dma_cleanup(dev);
        mt76x2_mcu_cleanup(dev);