projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25fe97c
)
can: j1939: main: j1939_ndev_to_priv(): avoid crash if can_ml_priv is NULL
author
Oleksij Rempel
<o.rempel@pengutronix.de>
Tue, 5 Nov 2019 10:07:08 +0000
(11:07 +0100)
committer
Marc Kleine-Budde
<mkl@pengutronix.de>
Wed, 13 Nov 2019 09:42:34 +0000
(10:42 +0100)
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
patch
|
blob
|
history
diff --git
a/net/can/j1939/main.c
b/net/can/j1939/main.c
index
def2f81
..
8dc935d
100644
(file)
--- a/
net/can/j1939/main.c
+++ b/
net/can/j1939/main.c
@@
-207,6
+207,9
@@
static inline struct j1939_priv *j1939_ndev_to_priv(struct net_device *ndev)
{
struct can_ml_priv *can_ml_priv = ndev->ml_priv;
+ if (!can_ml_priv)
+ return NULL;
+
return can_ml_priv->j1939_priv;
}