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 <[email protected]>
This commit is contained in:
Lorenzo Bianconi
2020-11-10 13:19:53 +01:00
committed by Felix Fietkau
parent 36089a655f
commit 68c4eedafd
5 changed files with 11 additions and 6 deletions
+2 -1
View File
@@ -57,7 +57,8 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
return 0;
error:
ieee80211_free_hw(mt76_hw(dev));
mt76_free_device(&dev->mt76);
return ret;
}