mt76: mt76x02u: fix possible memory leak in __mt76x02u_mcu_send_msg

[ Upstream commit cffd934115 ]

Free the skb if mt76u_bulk_msg fails in __mt76x02u_mcu_send_msg routine.

Fixes: 4c89ff2c74 ("mt76: split __mt76u_mcu_send_msg and mt76u_mcu_send_msg routines")
Co-developed-by: Gergo Koteles <soyer@irl.hu>
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Lorenzo Bianconi 2022-05-17 18:37:07 +02:00 коммит произвёл Greg Kroah-Hartman
Родитель 1a63d33006
Коммит f1609c4f4a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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,
MT_EP_OUT_INBAND_CMD);
if (ret)
return ret;
goto out;
if (wait_resp)
ret = mt76x02u_mcu_wait_resp(dev, seq);