diff options
author | Oleksij Rempel <o.rempel@pengutronix.de> | 2019-10-10 12:50:31 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2019-11-04 21:47:23 +0100 |
commit | 896daf723c845289a4ea1e68e74a5a5475aa796d (patch) | |
tree | abb29f62b0bbdb71c3c2b215df30314913f849ea /net/can | |
parent | can: j1939: fix resource leak of skb on error return paths (diff) | |
download | linux-896daf723c845289a4ea1e68e74a5a5475aa796d.tar.xz linux-896daf723c845289a4ea1e68e74a5a5475aa796d.zip |
can: j1939: fix memory leak if filters was set
Filters array is coped from user space and linked to the j1939 socket.
On socket release this memory was not freed.
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'net/can')
-rw-r--r-- | net/can/j1939/socket.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c index 5c6eabcb5df1..4d8ba701e15d 100644 --- a/net/can/j1939/socket.c +++ b/net/can/j1939/socket.c @@ -580,6 +580,7 @@ static int j1939_sk_release(struct socket *sock) j1939_netdev_stop(priv); } + kfree(jsk->filters); sock_orphan(sk); sock->sk = NULL; |