mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
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 <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
88fa973f59
commit
2fff7d77be
+5
-2
@@ -87,8 +87,10 @@ __mt76x02u_mcu_send_msg(struct mt76_dev *dev, struct sk_buff *skb,
|
|||||||
u32 info;
|
u32 info;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (test_bit(MT76_REMOVED, &dev->phy.state))
|
if (test_bit(MT76_REMOVED, &dev->phy.state)) {
|
||||||
return 0;
|
ret = 0;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (wait_resp) {
|
if (wait_resp) {
|
||||||
seq = ++dev->mcu.msg_seq & 0xf;
|
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)
|
if (wait_resp)
|
||||||
ret = mt76x02u_mcu_wait_resp(dev, seq);
|
ret = mt76x02u_mcu_wait_resp(dev, seq);
|
||||||
|
|
||||||
|
out:
|
||||||
consume_skb(skb);
|
consume_skb(skb);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user