|
@@ -161,6 +161,7 @@ struct net_device * alloc_netdev ( size_t priv_size ) {
|
161
|
161
|
|
162
|
162
|
netdev = calloc ( 1, sizeof ( *netdev ) + priv_size );
|
163
|
163
|
if ( netdev ) {
|
|
164
|
+ INIT_LIST_HEAD ( &netdev->references );
|
164
|
165
|
INIT_LIST_HEAD ( &netdev->rx_queue );
|
165
|
166
|
netdev->priv = ( ( ( void * ) netdev ) + sizeof ( *netdev ) );
|
166
|
167
|
}
|
|
@@ -201,6 +202,9 @@ void unregister_netdev ( struct net_device *netdev ) {
|
201
|
202
|
free_pkb ( pkb );
|
202
|
203
|
}
|
203
|
204
|
|
|
205
|
+ /* Kill off any persistent references to this device */
|
|
206
|
+ forget_references ( &netdev->references );
|
|
207
|
+
|
204
|
208
|
/* Remove from device list */
|
205
|
209
|
list_del ( &netdev->list );
|
206
|
210
|
DBG ( "%s unregistered\n", netdev_name ( netdev ) );
|