can: fix memory leak in initial namespace support
authorOliver Hartkopp <socketcan@hartkopp.net>
Tue, 25 Apr 2017 06:19:38 +0000 (08:19 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 25 Apr 2017 07:04:27 +0000 (09:04 +0200)
The can_rx_alldev_list is a per-net data structure now and allocated in
can_pernet_init(). Make sure the memory is free'd in can_pernet_exit() too.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
net/can/af_can.c

index abf7d854a94db9082eccb4d62d709b639c08a0ef..2c935babe466d927f180993fa796be819fedcb77 100644 (file)
@@ -903,6 +903,8 @@ static void can_pernet_exit(struct net *net)
                }
        }
        rcu_read_unlock();
+
+       kfree(net->can.can_rx_alldev_list);
 }
 
 /*