1 |
From d37458dffef56f6eee6ac6d567e7ea473aa94e8b Mon Sep 17 00:00:00 2001 |
2 |
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> |
3 |
Date: Fri, 24 Aug 2018 10:17:49 +0200 |
4 |
Subject: [PATCH 072/145] mt76x2u: run device cleanup routine if resume fails |
5 |
|
6 |
[ Upstream commit 9b2fd48d36e25b9be9ddb8be8cc1eb263a1d1843 ] |
7 |
|
8 |
Cleanup {tx,rx} and mcu queues if resume operation fails |
9 |
|
10 |
Fixes: ee676cd5017c ("mt76: add driver code for MT76x2u based devices") |
11 |
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> |
12 |
Signed-off-by: Kalle Valo <kvalo@codeaurora.org> |
13 |
Signed-off-by: Sasha Levin <sashal@kernel.org> |
14 |
--- |
15 |
drivers/net/wireless/mediatek/mt76/mt76x2_usb.c | 14 +++++++++++--- |
16 |
1 file changed, 11 insertions(+), 3 deletions(-) |
17 |
|
18 |
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2_usb.c b/drivers/net/wireless/mediatek/mt76/mt76x2_usb.c |
19 |
index 1428cfdee579..9594433234cc 100644 |
20 |
--- a/drivers/net/wireless/mediatek/mt76/mt76x2_usb.c |
21 |
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2_usb.c |
22 |
@@ -107,16 +107,24 @@ static int __maybe_unused mt76x2u_resume(struct usb_interface *intf) |
23 |
mt76u_mcu_complete_urb, |
24 |
&usb->mcu.cmpl); |
25 |
if (err < 0) |
26 |
- return err; |
27 |
+ goto err; |
28 |
|
29 |
err = mt76u_submit_rx_buffers(&dev->mt76); |
30 |
if (err < 0) |
31 |
- return err; |
32 |
+ goto err; |
33 |
|
34 |
tasklet_enable(&usb->rx_tasklet); |
35 |
tasklet_enable(&usb->tx_tasklet); |
36 |
|
37 |
- return mt76x2u_init_hardware(dev); |
38 |
+ err = mt76x2u_init_hardware(dev); |
39 |
+ if (err < 0) |
40 |
+ goto err; |
41 |
+ |
42 |
+ return 0; |
43 |
+ |
44 |
+err: |
45 |
+ mt76x2u_cleanup(dev); |
46 |
+ return err; |
47 |
} |
48 |
|
49 |
MODULE_DEVICE_TABLE(usb, mt76x2u_device_table); |
50 |
-- |
51 |
2.19.1 |
52 |
|