summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2020-10-13 11:33:49 +0300
committerFelix Fietkau <nbd@nbd.name>2020-12-04 16:31:11 +0300
commitbc348defcc6eceeb4f7784bf9a263ddb72fd3fb4 (patch)
tree1be48b3c2895cc2eefaab147f316df118c2272db /drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
parent468cc93be797301a99a95ac687f4ba5d749d02ba (diff)
downloadlinux-bc348defcc6eceeb4f7784bf9a263ddb72fd3fb4.tar.xz
mt76: fix memory leak if device probing fails
Run mt76_free_device instead of ieee80211_free_hw if device probing fails in order to remove the already allocated mt76 workqueue Fixes: a86f1d01f5ce5 ("mt76: move mt76 workqueue in common code") Fixes: f1d962369d568 ("mt76: mt7915: implement HE per-rate tx power support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7615/mmio.c')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7615/mmio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
index b108324aa816..a7f92fa0488f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
@@ -240,7 +240,8 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base,
return 0;
error:
- ieee80211_free_hw(mt76_hw(dev));
+ mt76_free_device(&dev->mt76);
+
return ret;
}