Commit 896daf72 authored by Oleksij Rempel's avatar Oleksij Rempel Committed by Marc Kleine-Budde

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: 9d71dd0c ("can: add support of SAE J1939 protocol")
Signed-off-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent db1a804c
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment