Skip to content

Commit e4d5a5f

Browse files
nbd168gregkh
authored andcommitted
wifi: mt76: fix linked list corruption
[ Upstream commit 49fba87 ] Never leave scheduled wcid entries on the temporary on-stack list Fixes: 0b3be9d ("wifi: mt76: add separate tx scheduling queue for off-channel tx") Link: https://patch.msgid.link/20250827085352.51636-6-nbd@nbd.name Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 2aef366 commit e4d5a5f

File tree

1 file changed

+3
-5
lines changed
  • drivers/net/wireless/mediatek/mt76

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid,
645645
static void mt76_txq_schedule_pending(struct mt76_phy *phy)
646646
{
647647
LIST_HEAD(tx_list);
648+
int ret = 0;
648649

649650
if (list_empty(&phy->tx_list))
650651
return;
@@ -656,13 +657,13 @@ static void mt76_txq_schedule_pending(struct mt76_phy *phy)
656657
list_splice_init(&phy->tx_list, &tx_list);
657658
while (!list_empty(&tx_list)) {
658659
struct mt76_wcid *wcid;
659-
int ret;
660660

661661
wcid = list_first_entry(&tx_list, struct mt76_wcid, tx_list);
662662
list_del_init(&wcid->tx_list);
663663

664664
spin_unlock(&phy->tx_lock);
665-
ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_offchannel);
665+
if (ret >= 0)
666+
ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_offchannel);
666667
if (ret >= 0 && !phy->offchannel)
667668
ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_pending);
668669
spin_lock(&phy->tx_lock);
@@ -671,9 +672,6 @@ static void mt76_txq_schedule_pending(struct mt76_phy *phy)
671672
!skb_queue_empty(&wcid->tx_offchannel) &&
672673
list_empty(&wcid->tx_list))
673674
list_add_tail(&wcid->tx_list, &phy->tx_list);
674-
675-
if (ret < 0)
676-
break;
677675
}
678676
spin_unlock(&phy->tx_lock);
679677

0 commit comments

Comments
 (0)