OSDN Git Service

mt76: fix memory leak if device probing fails
authorLorenzo Bianconi <lorenzo@kernel.org>
Tue, 13 Oct 2020 08:33:49 +0000 (10:33 +0200)
committerFelix Fietkau <nbd@nbd.name>
Fri, 4 Dec 2020 13:31:11 +0000 (14:31 +0100)
commitbc348defcc6eceeb4f7784bf9a263ddb72fd3fb4
tree1be48b3c2895cc2eefaab147f316df118c2272db
parent468cc93be797301a99a95ac687f4ba5d749d02ba
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>
drivers/net/wireless/mediatek/mt76/mt7603/pci.c
drivers/net/wireless/mediatek/mt76/mt7615/mmio.c
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
drivers/net/wireless/mediatek/mt76/mt76x2/pci.c
drivers/net/wireless/mediatek/mt76/mt7915/pci.c