diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2015-06-19 00:46:53 +0200 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-07-05 10:12:48 -0400 |
commit | d46c266ac221fcc2c9b5fb7496ac2967df23aca0 (patch) | |
tree | 09232d7b1a31d38413e901f2fde50868b5733abd | |
parent | c44ed568ae2ef49bb72d55c8a12e6ca19758b845 (diff) | |
download | lwn-d46c266ac221fcc2c9b5fb7496ac2967df23aca0.tar.gz lwn-d46c266ac221fcc2c9b5fb7496ac2967df23aca0.zip |
NET: ROSE: Don't dereference NULL neighbour pointer.
[ Upstream commit d496f7842aada20c61e6044b3395383fa972872c ]
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>
Cc: stable@vger.kernel.org #2.6.11+
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-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 a85c1a086ae4..67984fb42f14 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c @@ -192,7 +192,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; } } |