projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b813505
)
mt76: mt7915: drop zero-length packet to avoid Tx hang
author
Ryder Lee
<ryder.lee@mediatek.com>
Tue, 29 Dec 2020 04:15:30 +0000
(12:15 +0800)
committer
Felix Fietkau
<nbd@nbd.name>
Tue, 26 Jan 2021 19:07:47 +0000
(20:07 +0100)
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>
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
patch
|
blob
|
history
diff --git
a/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
b/drivers/net/wireless/mediatek/mt76/mt7915/mac.c
index
dab46bd
..
ecabab7
100644
(file)
--- a/
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
+++ b/
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
@@
-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;