Skip to contentSkip to conversation

mt76x2u: run device cleanup routine if resume fails

PATCH In review Lorenzo Bianconi 2 participants 2 messages Aug 24, 2018 – Aug 31, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 mt76x2u: run device cleanup routine if resume fails

Cleanup {tx,rx} and mcu queues if resume operation fails

Fixes ee676cd5017c ("mt76: add driver code for MT76x2u based devices")
---
 drivers/net/wireless/mediatek/mt76/mt76x2_usb.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/net/wireless/mediatek/mt76/mt76x2_usb.c +11 -3
index 1428cfdee579..9594433234cc 100644
@@ -107,16 +107,24 @@ static int __maybe_unused mt76x2u_resume(struct usb_interface *intf)
 			       mt76u_mcu_complete_urb,
 			       &usb->mcu.cmpl);
 	if (err < 0)
-		return err;
+		goto err;
 
 	err = mt76u_submit_rx_buffers(&dev->mt76);
 	if (err < 0)
-		return err;
+		goto err;
 
 	tasklet_enable(&usb->rx_tasklet);
 	tasklet_enable(&usb->tx_tasklet);
 
-	return mt76x2u_init_hardware(dev);
+	err = mt76x2u_init_hardware(dev);
+	if (err < 0)
+		goto err;
+
+	return 0;
+
+err:
+	mt76x2u_cleanup(dev);
+	return err;
 }
 
 MODULE_DEVICE_TABLE(usb, mt76x2u_device_table);
Signature · 1 line
2.17.1
#2 lore raw
Quoted 4 lines · Lorenzo Bianconi

Cleanup {tx,rx} and mcu queues if resume operation fails

Fixes ee676cd5017c ("mt76: add driver code for MT76x2u based devices")

Patch applied to wireless-drivers-next.git, thanks.

9b2fd48d36e2 mt76x2u: run device cleanup routine if resume fails

Signature · 3 lines
https://patchwork.kernel.org/patch/10574897/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches