提交 d496f784 编写于 作者: R Ralf Baechle 提交者: David S. Miller

NET: ROSE: Don't dereference NULL neighbour pointer.

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: NRalf Baechle <ralf@linux-mips.org>
Tested-by: NBernard Pidoux <f6bvp@free.fr>
Cc: stable@vger.kernel.org #2.6.11+
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 dfea2aa6
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册