Skip to content

Commit

Permalink
mt7603: limit station power save queue length to 64
Browse files Browse the repository at this point in the history
Avoid excessive memory use, in case something goes wrong.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
nbd168 committed Jan 21, 2019
1 parent 1c751f3 commit 2efa389
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mt7603/dma.c
Expand Up @@ -90,6 +90,10 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)

spin_lock_bh(&dev->ps_lock);
__skb_queue_tail(&msta->psq, skb);
if (skb_queue_len(&msta->psq) >= 64) {
skb = __skb_dequeue(&msta->psq);
dev_kfree_skb(skb);
}
spin_unlock_bh(&dev->ps_lock);
return;

Expand Down

0 comments on commit 2efa389

Please sign in to comment.