mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
can: af_can: can_pernet_exit(): no need to iterate over and cleanup registered CAN devices
The networking core takes care and unregisters every network device in a namespace before calling the can_pernet_exit() hook. This patch removes the unneeded cleanup. Acked-by: Oliver Hartkopp <[email protected]> Suggested-by: Kirill Tkhai <[email protected]> Signed-off-by: Oleksij Rempel <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
This commit is contained in:
parent
e2586a5796
commit
3f15035606
1 changed files with 0 additions and 15 deletions
|
|
@ -866,27 +866,12 @@ static int can_pernet_init(struct net *net)
|
|||
|
||||
static void can_pernet_exit(struct net *net)
|
||||
{
|
||||
struct net_device *dev;
|
||||
|
||||
if (IS_ENABLED(CONFIG_PROC_FS)) {
|
||||
can_remove_proc(net);
|
||||
if (stats_timer)
|
||||
del_timer_sync(&net->can.stattimer);
|
||||
}
|
||||
|
||||
/* remove created dev_rcv_lists from still registered CAN devices */
|
||||
rcu_read_lock();
|
||||
for_each_netdev_rcu(net, dev) {
|
||||
if (dev->type == ARPHRD_CAN && dev->ml_priv) {
|
||||
struct can_dev_rcv_lists *dev_rcv_lists = dev->ml_priv;
|
||||
|
||||
BUG_ON(dev_rcv_lists->entries);
|
||||
kfree(dev_rcv_lists);
|
||||
dev->ml_priv = NULL;
|
||||
}
|
||||
}
|
||||
rcu_read_unlock();
|
||||
|
||||
kfree(net->can.rx_alldev_list);
|
||||
kfree(net->can.pkg_stats);
|
||||
kfree(net->can.rcv_lists_stats);
|
||||
|
|
|
|||
Loading…
Reference in a new issue