Skip to content

Commit

Permalink
x25: decrement netdev reference counts on unload
Browse files Browse the repository at this point in the history
x25 does not decrement the network device reference counts on module unload.
Thus unregistering any pre-existing interface after unloading the x25 module
hangs and results in

 unregister_netdevice: waiting for tap0 to become free. Usage count = 1

This patch decrements the reference counts of all interfaces in x25_link_free,
the way it is already done in x25_link_device_down for NETDEV_DOWN events.

Signed-off-by: Apollon Oikonomopoulos <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Apollon Oikonomopoulos authored and davem330 committed Dec 8, 2010
1 parent 408cc29 commit 171995e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/x25/x25_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ void __exit x25_link_free(void)
list_for_each_safe(entry, tmp, &x25_neigh_list) {
nb = list_entry(entry, struct x25_neigh, node);
__x25_remove_neigh(nb);
dev_put(nb->dev);
}
write_unlock_bh(&x25_neigh_list_lock);
}

0 comments on commit 171995e

Please sign in to comment.