wifi: mt76: Fix missing barrier after initialization check in ath9k_wmi_event_tasklet()
PATCH 1/1 wifi: mt76: Fix missing barrier after initialization check in ath9k_wmi_event_tasklet()
The write memory barrier in ath9k_htc_probe_device() before writing to priv->initialized, so it seems like one is also needed after reading it, but seems like there is none after reading priv->initialized.
Add a read barrier after reading the priv->initialized flag to prevent reordering of reads.
Fixes 8b3046abc99e ("ath9k_htc: fix NULL pointer dereference at ath9k_htc_tx_get_packet()")
Signed-off-by Thomas Fourier <[email protected]>
--- drivers/net/wireless/ath/ath9k/wmi.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/wireless/ath/ath9k/wmi.c +5 -0
@@ -160,6 +160,11 @@ void ath9k_wmi_event_tasklet(struct tasklet_struct *t)kfree_skb (skb);continue ; } +/* +* Make sure ath9k_htc_probe_device() initialization is +* committed to memory before processing skb. +*/ +smp_rmb (); hdr = (struct wmi_cmd_hdr *) skb->data; cmd_id =be16_to_cpu (hdr->command_id);
Signature · 1 line
2.43.0