diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2015-06-19 01:46:53 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2015-08-12 17:33:16 +0300 |
commit | 8bbe4f448c01949084ef404eded3622086f052a6 (patch) | |
tree | ab4ed3ff36ab1da939cdc02549ffa1dc16e09781 /net/rose/af_rose.c | |
parent | 5e436e5b521702071b134842fe7463e29aa0ef83 (diff) | |
download | linux-8bbe4f448c01949084ef404eded3622086f052a6.tar.xz |
NET: ROSE: Don't dereference NULL neighbour pointer.
commit d496f7842aada20c61e6044b3395383fa972872c upstream.
A ROSE socket doesn't necessarily always have a neighbour pointer so check
if the neighbour pointer is valid before dereferencing it.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Tested-by: Bernard Pidoux <f6bvp@free.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/rose/af_rose.c')
-rw-r--r-- | net/rose/af_rose.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 686fb1ab2a08..233dbe62a36b 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -195,7 +195,8 @@ static void rose_kill_by_device(struct net_device *dev) if (rose->device == dev) { rose_disconnect(s, ENETUNREACH, ROSE_OUT_OF_ORDER, 0); - rose->neighbour->use--; + if (rose->neighbour) + rose->neighbour->use--; rose->device = NULL; } } |