diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2017-04-25 02:19:38 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2017-04-25 03:04:27 -0400 |
commit | a7bbd28f04ce4df26f07e96c4a743d529da99348 (patch) | |
tree | 51e8dc609713f0d6a4f6ecb84166420ceb2abe6a /net/can | |
parent | 51f3baad7de943780ce0c17bd7975df567dd6e14 (diff) |
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>
Diffstat (limited to 'net/can')
-rw-r--r-- | net/can/af_can.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c index abf7d854a94d..2c935babe466 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c | |||
@@ -903,6 +903,8 @@ static void can_pernet_exit(struct net *net) | |||
903 | } | 903 | } |
904 | } | 904 | } |
905 | rcu_read_unlock(); | 905 | rcu_read_unlock(); |
906 | |||
907 | kfree(net->can.can_rx_alldev_list); | ||
906 | } | 908 | } |
907 | 909 | ||
908 | /* | 910 | /* |