Skip to content

Commit

Permalink
mt76: mt7915: drop zero-length packet to avoid Tx hang
Browse files Browse the repository at this point in the history
Hardware wouldn't add LLC-SNAP when skb->data_len is 0, which causes
Tx hang, so add a check to drop this kind of packet.

Tested-by: Bo Jiao <bo.jiao@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
  • Loading branch information
ryderlee1110 authored and nbd168 committed Jan 4, 2021
1 parent 062f3f4 commit dbba9b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mt7915/mac.c
Expand Up @@ -954,6 +954,9 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
int id, i, nbuf = tx_info->nbuf - 1;
u8 *txwi = (u8 *)txwi_ptr;

if (unlikely(tx_info->skb->len <= ETH_HLEN))
return -EINVAL;

if (!wcid)
wcid = &dev->mt76.global_wcid;

Expand Down

0 comments on commit dbba9b9

Please sign in to comment.