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,
329329 if (!mt76_poll_msec (dev , MT_CONN_ON_MISC , MT_TOP_MISC2_FW_PWR_ON ,
330330 FW_STATE_PWR_ON << 1 , 500 )) {
331331 dev_err (dev -> mt76 .dev , "Timeout for power on\n" );
332- return - EIO ;
332+ ret = - EIO ;
333+ goto error ;
333334 }
334335
335336alloc_queues :
336337 ret = mt76u_alloc_mcu_queue (& dev -> mt76 );
337338 if (ret )
338- goto error ;
339+ goto error_free_q ;
339340
340341 ret = mt76u_alloc_queues (& dev -> mt76 );
341342 if (ret )
342- goto error ;
343+ goto error_free_q ;
343344
344345 ret = mt7663u_register_device (dev );
345346 if (ret )
346- goto error_freeq ;
347+ goto error_free_q ;
347348
348349 return 0 ;
349350
350- error_freeq :
351+ error_free_q :
351352 mt76u_queues_deinit (& dev -> mt76 );
352353error :
353354 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)
10671067
10681068static void mt76u_free_tx (struct mt76_dev * dev )
10691069{
1070- struct mt76_queue * q ;
1071- int i , j ;
1070+ int i ;
10721071
10731072 for (i = 0 ; i < IEEE80211_NUM_ACS ; i ++ ) {
1073+ struct mt76_queue * q ;
1074+ int j ;
1075+
10741076 q = dev -> q_tx [i ].q ;
1077+ if (!q )
1078+ continue ;
1079+
10751080 for (j = 0 ; j < q -> ndesc ; j ++ )
10761081 usb_free_urb (q -> entry [j ].urb );
10771082 }
10781083}
10791084
10801085void mt76u_stop_tx (struct mt76_dev * dev )
10811086{
1082- struct mt76_queue_entry entry ;
1083- struct mt76_queue * q ;
1084- int i , j , ret ;
1087+ int ret ;
10851088
10861089 ret = wait_event_timeout (dev -> tx_wait , !mt76_has_tx_pending (& dev -> phy ),
10871090 HZ / 5 );
10881091 if (!ret ) {
1092+ struct mt76_queue_entry entry ;
1093+ struct mt76_queue * q ;
1094+ int i , j ;
1095+
10891096 dev_err (dev -> dev , "timed out waiting for pending tx\n" );
10901097
10911098 for (i = 0 ; i < IEEE80211_NUM_ACS ; i ++ ) {
10921099 q = dev -> q_tx [i ].q ;
1100+ if (!q )
1101+ continue ;
1102+
10931103 for (j = 0 ; j < q -> ndesc ; j ++ )
10941104 usb_kill_urb (q -> entry [j ].urb );
10951105 }
@@ -1101,6 +1111,8 @@ void mt76u_stop_tx(struct mt76_dev *dev)
11011111 */
11021112 for (i = 0 ; i < IEEE80211_NUM_ACS ; i ++ ) {
11031113 q = dev -> q_tx [i ].q ;
1114+ if (!q )
1115+ continue ;
11041116
11051117 /* Assure we are in sync with killed tasklet. */
11061118 spin_lock_bh (& q -> lock );
You can’t perform that action at this time.
0 commit comments