From: Marc Kleine-Budde mkl@pengutronix.de
mainline inclusion from mainline-v5.4-rc1 commit 3f15035606934a499975e4a5879a9499f072c179 category: feature bugzilla: 38684 CVE: NA
---------------------------
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 socketcan@hartkopp.net Suggested-by: Kirill Tkhai ktkhai@virtuozzo.com Signed-off-by: Oleksij Rempel o.rempel@pengutronix.de Signed-off-by: Marc Kleine-Budde mkl@pengutronix.de
Conflicts: net/can/af_can.c
Signed-off-by: Zhang Changzhong zhangchangzhong@huawei.com Reviewed-by: YueHaibing yuehaibing@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- net/can/af_can.c | 15 --------------- 1 file changed, 15 deletions(-)
diff --git a/net/can/af_can.c b/net/can/af_can.c index 87447a1d099d..91062e45ee21 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c @@ -902,27 +902,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.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.can_rx_alldev_list); kfree(net->can.can_stats); kfree(net->can.can_pstats);