From: Richard Alpe Date: Thu, 3 Mar 2016 13:20:41 +0000 (+0100) Subject: tipc: don't check link reset on non existing link X-Git-Tag: v4.9.8~2476^2~124 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2837f39c7cdbd209ab04d1c1f4eca015a40d5cd6;p=platform%2Fkernel%2Flinux-rpi3.git tipc: don't check link reset on non existing link Make sure we have a link before checking if it has been reset or not. Prior to this patch tipc_link_is_reset() could be called with a non existing link, resulting in a null pointer dereference. Signed-off-by: Richard Alpe Acked-by: Jon Maloy Reviewed-by: Erik Hugne Signed-off-by: David S. Miller --- diff --git a/net/tipc/node.c b/net/tipc/node.c index cdb7950..590d597 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -843,7 +843,7 @@ void tipc_node_check_dest(struct net *net, u32 onode, memcpy(&le->maddr, maddr, sizeof(*maddr)); exit: tipc_node_write_unlock(n); - if (reset && !tipc_link_is_reset(l)) + if (reset && l && !tipc_link_is_reset(l)) tipc_node_link_down(n, b->identity, false); tipc_node_put(n); }