Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

can: fix memory leak in initial namespace support

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>

authored by

Oliver Hartkopp and committed by
Marc Kleine-Budde
a7bbd28f 51f3baad

+2
+2
net/can/af_can.c
··· 903 903 } 904 904 } 905 905 rcu_read_unlock(); 906 + 907 + kfree(net->can.can_rx_alldev_list); 906 908 } 907 909 908 910 /*