summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
diff options
context:
space:
mode:
authorYuanjun Gong <ruc_gongyuanjun@163.com>2023-07-17 22:50:08 +0800
committerFelix Fietkau <nbd@nbd.name>2023-07-31 10:56:17 +0200
commit3bb014c72b087fa1d440d1b83cb3dfcfc4d24cff (patch)
tree4f67353f3235f6f42f5bc06657dbe5960e15d9b2 /drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
parent74f12d511625e603fac8c0c2b6872e687e56dd61 (diff)
downloadlinux-stable-3bb014c72b087fa1d440d1b83cb3dfcfc4d24cff.tar.gz
linux-stable-3bb014c72b087fa1d440d1b83cb3dfcfc4d24cff.tar.bz2
linux-stable-3bb014c72b087fa1d440d1b83cb3dfcfc4d24cff.zip
wifi: mt76: mt76x02: fix return value check in mt76x02_mac_process_rx
in mt76x02_mac_process_rx(), return an error code if an unexpected result is returned by pskb_trim. Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt76x02_mac.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x02_mac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
index 3e41d809ade3..d5db6ffd6d36 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
@@ -853,7 +853,8 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb,
if (WARN_ON_ONCE(len > skb->len))
return -EINVAL;
- pskb_trim(skb, len);
+ if (pskb_trim(skb, len))
+ return -EINVAL;
status->chains = BIT(0);
signal = mt76x02_mac_get_rssi(dev, rxwi->rssi[0], 0);