]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mt76: fix potential memory leak in mt76_wmac_probe()
authorAbdun Nihaal <abdun.nihaal@gmail.com>
Wed, 9 Jul 2025 14:55:30 +0000 (20:25 +0530)
committerFelix Fietkau <nbd@nbd.name>
Mon, 15 Sep 2025 07:47:38 +0000 (09:47 +0200)
commit42754b7de2b1a2cf116c5e3f1e8e78392f4ed700
tree279f83c0153e1af8d070e55cf90cc0749109d871
parent74e756b9e28af3ee94a7ea480bb39694be5fbd96
wifi: mt76: fix potential memory leak in mt76_wmac_probe()

In mt76_wmac_probe(), when the mt76_alloc_device() call succeeds, memory
is allocated for both struct ieee80211_hw and a workqueue. However, on
the error path, the workqueue is not freed. Fix that by calling
mt76_free_device() on the error path.

Fixes: c8846e101502 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://patch.msgid.link/20250709145532.41246-1-abdun.nihaal@gmail.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7603/soc.c