Commit 57519239 authored by Abdun Nihaal's avatar Abdun Nihaal Committed by Greg Kroah-Hartman
Browse files

wifi: mt76: fix potential memory leak in mt76_wmac_probe()



[ Upstream commit 42754b7d ]

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: c8846e10 ("mt76: add driver for MT7603E and MT7628/7688")
Signed-off-by: default avatarAbdun Nihaal <abdun.nihaal@gmail.com>
Reviewed-by: default avatarJiri Slaby <jirislaby@kernel.org>
Link: https://patch.msgid.link/20250709145532.41246-1-abdun.nihaal@gmail.com


Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 04eb384c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment