mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
wifi: mt76: add memory barrier to SDIO queue kick
[ Upstream commit5f54237ad7] 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:764dee47e2("mt76: sdio: move common code in mt76_sdio module") Signed-off-by: Deren Wu <deren.wu@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
f8baf3e6c3
commit
eadd65fc56
@@ -562,6 +562,10 @@ mt76s_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q,
|
||||
|
||||
q->entry[q->head].buf_sz = len;
|
||||
q->entry[q->head].skb = skb;
|
||||
|
||||
/* ensure the entry fully updated before bus access */
|
||||
smp_wmb();
|
||||
|
||||
q->head = (q->head + 1) % q->ndesc;
|
||||
q->queued++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user