summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorSean Wang <sean.wang@mediatek.com>2020-07-08 03:16:47 +0800
committerFelix Fietkau <nbd@nbd.name>2020-07-21 19:01:18 +0200
commitc876039e95559350ee101d4b6f6084d9803f2995 (patch)
tree6404c0efbe8007a53ab26faf6850c4c0e7bc67dc /drivers/net
parent4a850f8dc68b8c4a20333521b31600c9d31ccb5d (diff)
mt76: mt7663u: fix potential memory leak in mcu message handler
Fix potential memory leak in mcu message handler on error condition. Fixes: eb99cc95c3b6 ("mt76: mt7615: introduce mt7663u support") Acked-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/usb_mcu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/usb_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/usb_mcu.c
index 54885ad97891..39cd7dd95c9c 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/usb_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/usb_mcu.c
@@ -34,7 +34,6 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
ret = mt76u_bulk_msg(&dev->mt76, skb->data, skb->len, NULL,
1000, ep);
- dev_kfree_skb(skb);
if (ret < 0)
goto out;
@@ -43,6 +42,7 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
out:
mutex_unlock(&mdev->mcu.mutex);
+ dev_kfree_skb(skb);
return ret;
}