summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek
diff options
context:
space:
mode:
authorNavid Emamdoost <navid.emamdoost@gmail.com>2020-07-18 00:47:26 -0500
committerFelix Fietkau <nbd@nbd.name>2020-07-21 19:01:19 +0200
commit5648d1c9cadb0a6afb29dd8891159906dadf5c77 (patch)
treedeaaeff2f5c8f4cd2cd1ad73c0380dfcc723e3ca /drivers/net/wireless/mediatek
parent2bccc8415883c1cd5ae8836548d9783dbbd84999 (diff)
mt76: mt76u: add missing release on skb in __mt76x02u_mcu_send_msg
In the implementation of __mt76x02u_mcu_send_msg() the skb is consumed all execution paths except one. Release skb before returning if test_bit() fails. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c
index a30bb536fc8a..e43d13d7c988 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c
@@ -87,8 +87,10 @@ __mt76x02u_mcu_send_msg(struct mt76_dev *dev, struct sk_buff *skb,
u32 info;
int ret;
- if (test_bit(MT76_REMOVED, &dev->phy.state))
- return 0;
+ if (test_bit(MT76_REMOVED, &dev->phy.state)) {
+ ret = 0;
+ goto out;
+ }
if (wait_resp) {
seq = ++dev->mcu.msg_seq & 0xf;
@@ -111,6 +113,7 @@ __mt76x02u_mcu_send_msg(struct mt76_dev *dev, struct sk_buff *skb,
if (wait_resp)
ret = mt76x02u_mcu_wait_resp(dev, seq);
+out:
consume_skb(skb);
return ret;