提交 5479ad0c 编写于 作者: L Lorenzo Bianconi 提交者: Zheng Zengkai

mt76: mt76x02u: fix possible memory leak in __mt76x02u_mcu_send_msg

stable inclusion
from stable-v5.10.137
commit 3ad958bc488e3ecb0207d31621c00efb86f17482
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=3ad958bc488e3ecb0207d31621c00efb86f17482

--------------------------------

[ Upstream commit cffd9341 ]

Free the skb if mt76u_bulk_msg fails in __mt76x02u_mcu_send_msg routine.

Fixes: 4c89ff2c ("mt76: split __mt76u_mcu_send_msg and mt76u_mcu_send_msg routines")
Co-developed-by: NGergo Koteles <soyer@irl.hu>
Signed-off-by: NGergo Koteles <soyer@irl.hu>
Signed-off-by: NLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: NFelix Fietkau <nbd@nbd.name>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 feb3dc76
...@@ -108,7 +108,7 @@ __mt76x02u_mcu_send_msg(struct mt76_dev *dev, struct sk_buff *skb, ...@@ -108,7 +108,7 @@ __mt76x02u_mcu_send_msg(struct mt76_dev *dev, struct sk_buff *skb,
ret = mt76u_bulk_msg(dev, skb->data, skb->len, NULL, 500, ret = mt76u_bulk_msg(dev, skb->data, skb->len, NULL, 500,
MT_EP_OUT_INBAND_CMD); MT_EP_OUT_INBAND_CMD);
if (ret) if (ret)
return ret; goto out;
if (wait_resp) if (wait_resp)
ret = mt76x02u_mcu_wait_resp(dev, seq); ret = mt76x02u_mcu_wait_resp(dev, seq);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册