mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 21:36:52 +00:00
mt76x0: fix memory leak during hw probe
Fix memory leak during hw probe if mt76x0_register_device fails since MT76_STATE_INITIALIZED has not set yet and mt76x0_cleanup does not free tx/rx queues and mcu buffers Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Stanislaw Gruszka <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
aae3fb8f53
commit
3c693a1492
+1
-3
@@ -468,9 +468,7 @@ err:
|
||||
|
||||
void mt76x0_cleanup(struct mt76x0_dev *dev)
|
||||
{
|
||||
if (!test_and_clear_bit(MT76_STATE_INITIALIZED, &dev->mt76.state))
|
||||
return;
|
||||
|
||||
clear_bit(MT76_STATE_INITIALIZED, &dev->mt76.state);
|
||||
mt76x0_chip_onoff(dev, false, false);
|
||||
mt76u_queues_deinit(&dev->mt76);
|
||||
mt76u_mcu_deinit(&dev->mt76);
|
||||
|
||||
Reference in New Issue
Block a user