Skip to content

Commit a7bbd28

Browse files
hartkoppmarckleinebudde
authored andcommitted
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>
1 parent 51f3baa commit a7bbd28

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/can/af_can.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,8 @@ static void can_pernet_exit(struct net *net)
903903
}
904904
}
905905
rcu_read_unlock();
906+
907+
kfree(net->can.can_rx_alldev_list);
906908
}
907909

908910
/*

0 commit comments

Comments
 (0)