Commit da5b4d93 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

wifi: mt76: mt7996: fix memory leak in mt7996_mcu_exit

Always purge mcu skb queues in mt7996_mcu_exit routine even if
mt7996_firmware_state fails.

Fixes: 98686cd2 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices")
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 49bd7828
...@@ -2460,13 +2460,14 @@ void mt7996_mcu_exit(struct mt7996_dev *dev) ...@@ -2460,13 +2460,14 @@ void mt7996_mcu_exit(struct mt7996_dev *dev)
__mt76_mcu_restart(&dev->mt76); __mt76_mcu_restart(&dev->mt76);
if (mt7996_firmware_state(dev, false)) { if (mt7996_firmware_state(dev, false)) {
dev_err(dev->mt76.dev, "Failed to exit mcu\n"); dev_err(dev->mt76.dev, "Failed to exit mcu\n");
return; goto out;
} }
mt76_wr(dev, MT_TOP_LPCR_HOST_BAND(0), MT_TOP_LPCR_HOST_FW_OWN); mt76_wr(dev, MT_TOP_LPCR_HOST_BAND(0), MT_TOP_LPCR_HOST_FW_OWN);
if (dev->hif2) if (dev->hif2)
mt76_wr(dev, MT_TOP_LPCR_HOST_BAND(1), mt76_wr(dev, MT_TOP_LPCR_HOST_BAND(1),
MT_TOP_LPCR_HOST_FW_OWN); MT_TOP_LPCR_HOST_FW_OWN);
out:
skb_queue_purge(&dev->mt76.mcu.res_q); skb_queue_purge(&dev->mt76.mcu.res_q);
} }
......
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