Skip to content

Commit

Permalink
can: fix memory leak in initial namespace support
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
  • Loading branch information
hartkopp authored and marckleinebudde committed Apr 25, 2017
1 parent 51f3baa commit a7bbd28
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/can/af_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,8 @@ static void can_pernet_exit(struct net *net)
}
}
rcu_read_unlock();

kfree(net->can.can_rx_alldev_list);
}

/*
Expand Down

0 comments on commit a7bbd28

Please sign in to comment.