File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed
drivers/net/wireless/mediatek/mt76 Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -329,25 +329,26 @@ static int mt7663u_probe(struct usb_interface *usb_intf,
329
329
if (!mt76_poll_msec (dev , MT_CONN_ON_MISC , MT_TOP_MISC2_FW_PWR_ON ,
330
330
FW_STATE_PWR_ON << 1 , 500 )) {
331
331
dev_err (dev -> mt76 .dev , "Timeout for power on\n" );
332
- return - EIO ;
332
+ ret = - EIO ;
333
+ goto error ;
333
334
}
334
335
335
336
alloc_queues :
336
337
ret = mt76u_alloc_mcu_queue (& dev -> mt76 );
337
338
if (ret )
338
- goto error ;
339
+ goto error_free_q ;
339
340
340
341
ret = mt76u_alloc_queues (& dev -> mt76 );
341
342
if (ret )
342
- goto error ;
343
+ goto error_free_q ;
343
344
344
345
ret = mt7663u_register_device (dev );
345
346
if (ret )
346
- goto error_freeq ;
347
+ goto error_free_q ;
347
348
348
349
return 0 ;
349
350
350
- error_freeq :
351
+ error_free_q :
351
352
mt76u_queues_deinit (& dev -> mt76 );
352
353
error :
353
354
mt76u_deinit (& dev -> mt76 );
Original file line number Diff line number Diff line change @@ -1067,29 +1067,39 @@ static int mt76u_alloc_tx(struct mt76_dev *dev)
1067
1067
1068
1068
static void mt76u_free_tx (struct mt76_dev * dev )
1069
1069
{
1070
- struct mt76_queue * q ;
1071
- int i , j ;
1070
+ int i ;
1072
1071
1073
1072
for (i = 0 ; i < IEEE80211_NUM_ACS ; i ++ ) {
1073
+ struct mt76_queue * q ;
1074
+ int j ;
1075
+
1074
1076
q = dev -> q_tx [i ].q ;
1077
+ if (!q )
1078
+ continue ;
1079
+
1075
1080
for (j = 0 ; j < q -> ndesc ; j ++ )
1076
1081
usb_free_urb (q -> entry [j ].urb );
1077
1082
}
1078
1083
}
1079
1084
1080
1085
void mt76u_stop_tx (struct mt76_dev * dev )
1081
1086
{
1082
- struct mt76_queue_entry entry ;
1083
- struct mt76_queue * q ;
1084
- int i , j , ret ;
1087
+ int ret ;
1085
1088
1086
1089
ret = wait_event_timeout (dev -> tx_wait , !mt76_has_tx_pending (& dev -> phy ),
1087
1090
HZ / 5 );
1088
1091
if (!ret ) {
1092
+ struct mt76_queue_entry entry ;
1093
+ struct mt76_queue * q ;
1094
+ int i , j ;
1095
+
1089
1096
dev_err (dev -> dev , "timed out waiting for pending tx\n" );
1090
1097
1091
1098
for (i = 0 ; i < IEEE80211_NUM_ACS ; i ++ ) {
1092
1099
q = dev -> q_tx [i ].q ;
1100
+ if (!q )
1101
+ continue ;
1102
+
1093
1103
for (j = 0 ; j < q -> ndesc ; j ++ )
1094
1104
usb_kill_urb (q -> entry [j ].urb );
1095
1105
}
@@ -1101,6 +1111,8 @@ void mt76u_stop_tx(struct mt76_dev *dev)
1101
1111
*/
1102
1112
for (i = 0 ; i < IEEE80211_NUM_ACS ; i ++ ) {
1103
1113
q = dev -> q_tx [i ].q ;
1114
+ if (!q )
1115
+ continue ;
1104
1116
1105
1117
/* Assure we are in sync with killed tasklet. */
1106
1118
spin_lock_bh (& q -> lock );
You can’t perform that action at this time.
0 commit comments