Skip to content

Commit 5f54237

Browse files
derennbd168
authored andcommitted
wifi: mt76: add memory barrier to SDIO queue kick
Ensure the entry has been fully updated before SDIO bus worker access it. This patch would fix potential memory risk in both mt7663s and mt7921s. Fixes: 764dee4 ("mt76: sdio: move common code in mt76_sdio module") Signed-off-by: Deren Wu <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
1 parent 09f4417 commit 5f54237

File tree

1 file changed

+4
-0
lines changed
  • drivers/net/wireless/mediatek/mt76

1 file changed

+4
-0
lines changed

drivers/net/wireless/mediatek/mt76/sdio.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,10 @@ mt76s_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q,
562562

563563
q->entry[q->head].buf_sz = len;
564564
q->entry[q->head].skb = skb;
565+
566+
/* ensure the entry fully updated before bus access */
567+
smp_wmb();
568+
565569
q->head = (q->head + 1) % q->ndesc;
566570
q->queued++;
567571

0 commit comments

Comments
 (0)