]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mt76: mt7615: Fix memory leak in mt7615_mcu_wtbl_sta_add()
authorZilin Guan <zilin@seu.edu.cn>
Thu, 13 Nov 2025 06:24:15 +0000 (06:24 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:15 +0000 (14:03 +0100)
commit4d42aba0ee49c0aa015c50c4f2a07cf8fa1c3a49
tree745a08c46333c3ad6aa28a3d4a242dea404f55c1
parentf4c57afff3b096e7237c51b9a55f52fd311e3348
mt76: mt7615: Fix memory leak in mt7615_mcu_wtbl_sta_add()

[ Upstream commit 53d1548612670aa8b5d89745116cc33d9d172863 ]

In mt7615_mcu_wtbl_sta_add(), an skb sskb is allocated. If the
subsequent call to mt76_connac_mcu_alloc_wtbl_req() fails, the function
returns an error without freeing sskb, leading to a memory leak.

Fix this by calling dev_kfree_skb() on sskb in the error handling path
to ensure it is properly released.

Fixes: 99c457d902cf9 ("mt76: mt7615: move mt7615_mcu_set_bmc to mt7615_mcu_ops")
Signed-off-by: Zilin Guan <zilin@seu.edu.cn>
Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20251113062415.103611-1-zilin@seu.edu.cn
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c