Commit c876039e authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau

mt76: mt7663u: fix potential memory leak in mcu message handler

Fix potential memory leak in mcu message handler on error condition.

Fixes: eb99cc95 ("mt76: mt7615: introduce mt7663u support")
Acked-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 4a850f8d
...@@ -34,7 +34,6 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, ...@@ -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, ret = mt76u_bulk_msg(&dev->mt76, skb->data, skb->len, NULL,
1000, ep); 1000, ep);
dev_kfree_skb(skb);
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -43,6 +42,7 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, ...@@ -43,6 +42,7 @@ mt7663u_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
out: out:
mutex_unlock(&mdev->mcu.mutex); mutex_unlock(&mdev->mcu.mutex);
dev_kfree_skb(skb);
return ret; return ret;
} }
......
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