@@ -707,6 +707,12 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
707
707
INIT_WORK (& pDevice -> read_work_item , RXvWorkItem );
708
708
INIT_WORK (& pDevice -> rx_mng_work_item , RXvMngWorkItem );
709
709
710
+ pDevice -> pControlURB = usb_alloc_urb (0 , GFP_ATOMIC );
711
+ if (!pDevice -> pControlURB ) {
712
+ DBG_PRT (MSG_LEVEL_ERR , KERN_ERR "Failed to alloc control urb\n" );
713
+ goto err_nomem ;
714
+ }
715
+
710
716
pDevice -> tx_80211 = device_dma0_tx_80211 ;
711
717
pDevice -> vnt_mgmt .pAdapter = (void * ) pDevice ;
712
718
@@ -853,23 +859,15 @@ static bool device_alloc_bufs(struct vnt_private *pDevice)
853
859
pRCB ++ ;
854
860
}
855
861
856
- pDevice -> pControlURB = usb_alloc_urb (0 , GFP_ATOMIC );
857
- if (pDevice -> pControlURB == NULL ) {
858
- DBG_PRT (MSG_LEVEL_ERR ,KERN_ERR "Failed to alloc control urb\n" );
859
- goto free_rx_tx ;
860
- }
861
-
862
862
pDevice -> pInterruptURB = usb_alloc_urb (0 , GFP_ATOMIC );
863
863
if (pDevice -> pInterruptURB == NULL ) {
864
864
DBG_PRT (MSG_LEVEL_ERR ,KERN_ERR "Failed to alloc int urb\n" );
865
- usb_free_urb (pDevice -> pControlURB );
866
865
goto free_rx_tx ;
867
866
}
868
867
869
868
pDevice -> intBuf .pDataBuf = kmalloc (MAX_INTERRUPT_SIZE , GFP_KERNEL );
870
869
if (pDevice -> intBuf .pDataBuf == NULL ) {
871
870
DBG_PRT (MSG_LEVEL_ERR ,KERN_ERR "Failed to alloc int buf\n" );
872
- usb_free_urb (pDevice -> pControlURB );
873
871
usb_free_urb (pDevice -> pInterruptURB );
874
872
goto free_rx_tx ;
875
873
}
@@ -1040,9 +1038,7 @@ static int device_open(struct net_device *dev)
1040
1038
device_free_rx_bufs (pDevice );
1041
1039
device_free_tx_bufs (pDevice );
1042
1040
device_free_int_bufs (pDevice );
1043
- usb_kill_urb (pDevice -> pControlURB );
1044
1041
usb_kill_urb (pDevice -> pInterruptURB );
1045
- usb_free_urb (pDevice -> pControlURB );
1046
1042
usb_free_urb (pDevice -> pInterruptURB );
1047
1043
1048
1044
DBG_PRT (MSG_LEVEL_DEBUG , KERN_INFO "device_open fail.. \n" );
@@ -1113,9 +1109,7 @@ static int device_close(struct net_device *dev)
1113
1109
device_free_int_bufs (pDevice );
1114
1110
device_free_frag_bufs (pDevice );
1115
1111
1116
- usb_kill_urb (pDevice -> pControlURB );
1117
1112
usb_kill_urb (pDevice -> pInterruptURB );
1118
- usb_free_urb (pDevice -> pControlURB );
1119
1113
usb_free_urb (pDevice -> pInterruptURB );
1120
1114
1121
1115
BSSvClearNodeDBTable (pDevice , 0 );
@@ -1139,9 +1133,12 @@ static void vt6656_disconnect(struct usb_interface *intf)
1139
1133
1140
1134
if (device -> dev ) {
1141
1135
unregister_netdev (device -> dev );
1136
+
1137
+ usb_kill_urb (device -> pControlURB );
1138
+ usb_free_urb (device -> pControlURB );
1139
+
1142
1140
free_netdev (device -> dev );
1143
1141
}
1144
-
1145
1142
}
1146
1143
1147
1144
static int device_dma0_tx_80211 (struct sk_buff * skb , struct net_device * dev )
0 commit comments