can: j1939: main: j1939_ndev_to_priv(): avoid crash if can_ml_priv is NULL
authorOleksij Rempel <o.rempel@pengutronix.de>
Tue, 5 Nov 2019 10:07:08 +0000 (11:07 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 13 Nov 2019 09:42:34 +0000 (10:42 +0100)
commitc48c8c1e2e81e71a0f13b83cc5124333f3750064
tree14c1cad59500c38b1f03b4d0ca840b8753c8bcff
parent25fe97cb7620ef2e6b4f44ef0de4e371adf6c1d0
can: j1939: main: j1939_ndev_to_priv(): avoid crash if can_ml_priv is NULL

This patch avoids a NULL pointer deref crash if ndev->ml_priv is NULL.

Reported-by: syzbot+95c8e0d9dffde15b6c5c@syzkaller.appspotmail.com
Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
net/can/j1939/main.c