can: j1939: move j1939_priv_put() into sk_destruct callback
authorOleksij Rempel <o.rempel@pengutronix.de>
Thu, 7 Nov 2019 10:57:36 +0000 (11:57 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 13 Nov 2019 09:42:33 +0000 (10:42 +0100)
commit25fe97cb7620ef2e6b4f44ef0de4e371adf6c1d0
tree6dab8ddc70be226d9afd6faa2baf70cd57428768
parent975987e7015bb12a482df7f14fd524417d2c8e8f
can: j1939: move j1939_priv_put() into sk_destruct callback

This patch delays the j1939_priv_put() until the socket is destroyed via
the sk_destruct callback, to avoid use-after-free problems.

Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
net/can/j1939/socket.c