[PATCH] wifi: mt76: fix potential memory leak in mt76_wmac_probe()

Jiri Slaby jirislaby at kernel.org
Wed Jul 9 22:47:25 PDT 2025


On 09. 07. 25, 16:55, Abdun Nihaal wrote:
> 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 at gmail.com>

I am not sure, why I am CCed, but makes sense anyway (free the one 
obtained by alloc_ordered_workqueue() in mt76_alloc_device()):

Reviewed-by: Jiri Slaby <jirislaby at kernel.org>

-- 
js
suse labs



More information about the Linux-mediatek mailing list