Skip to contentSkip to conversation

ath10k: Fix crash during rmmod when probe firmware fails

PATCH Superseded Mohammed Shafi Shajakhan 1 participant 1 message Dec 20, 2016 Qualcomm Atheros ATH10K wireless driver

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ath10k: Fix crash during rmmod when probe firmware fails

From: Mohammed Shafi Shajakhan <[email protected]>

This fixes the below crash when ath10k probe firmware fails, NAPI polling tries to access a rx ring resource which was never allocated, fix this by disabling NAPI right away once the probe firmware fails by calling 'ath10k_hif_stop'. Its good to note that the error is never propogated to 'ath10k_pci_probe' when ath10k_core_register fails, so calling 'ath10k_hif_stop' to cleanup PCI related things seems to be ok

BUG: unable to handle kernel NULL pointer dereference at (null)
IP:  __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]
__ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core]

Call Trace:

[<ffffffffa113ec62>] ath10k_htt_rx_msdu_buff_replenish+0x42/0x90

[ath10k_core]
[<ffffffffa113f393>] ath10k_htt_txrx_compl_task+0x433/0x17d0 [ath10k_core]
[<ffffffff8114406d>] ? __wake_up_common+0x4d/0x80 [<ffffffff811349ec>] ? cpu_load_update+0xdc/0x150 [<ffffffffa119301d>] ? ath10k_pci_read32+0xd/0x10 [ath10k_pci]

[<ffffffffa1195b17>] ath10k_pci_napi_poll+0x47/0x110 [ath10k_pci]
[<ffffffff817863af>] net_rx_action+0x20f/0x370
Fixes 3c97f5de1f28 ("ath10k: implement NAPI support")
---
 drivers/net/wireless/ath/ath10k/core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath10k/core.c +1 -0
index f7ea4de..15bccc9 100644
@@ -2164,6 +2164,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
 	ath10k_core_free_firmware_files(ar);
 
 err_power_down:
+	ath10k_hif_stop(ar);
 	ath10k_hif_power_down(ar);
 
 	return ret;
Signature · 1 line
1.9.1