Commit b747fa34 authored by Ryder Lee's avatar Ryder Lee Committed by Felix Fietkau

mt76: mt7915: drop zero-length packet to avoid Tx hang

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: default avatarBo Jiao <bo.jiao@mediatek.com>
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent b8135057
......@@ -942,6 +942,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment