[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709145532.41246-1-abdun.nihaal@gmail.com>
Date: Wed, 9 Jul 2025 20:25:30 +0530
From: Abdun Nihaal <abdun.nihaal@...il.com>
To: nbd@....name
Cc: Abdun Nihaal <abdun.nihaal@...il.com>,
lorenzo@...nel.org,
ryder.lee@...iatek.com,
shayne.chen@...iatek.com,
sean.wang@...iatek.com,
matthias.bgg@...il.com,
angelogioacchino.delregno@...labora.com,
kvalo@...nel.org,
toke@...e.dk,
jeff.johnson@....qualcomm.com,
jirislaby@...nel.org,
u.kleine-koenig@...libre.com,
linux-wireless@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: [PATCH] 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@...il.com>
---
This patch is compile tested only. Not tested on real hardware.
drivers/net/wireless/mediatek/mt76/mt7603/soc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
index 08590aa68356..1dd372372048 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/soc.c
@@ -48,7 +48,7 @@ mt76_wmac_probe(struct platform_device *pdev)
return 0;
error:
- ieee80211_free_hw(mt76_hw(dev));
+ mt76_free_device(mdev);
return ret;
}
--
2.43.0
Powered by blists - more mailing lists