Commit 2837f39c authored by Richard Alpe's avatar Richard Alpe Committed by David S. Miller

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: default avatarRichard Alpe <richard.alpe@ericsson.com>
Acked-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Reviewed-by: default avatarErik Hugne <erik.hugne@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9b300960
...@@ -843,7 +843,7 @@ void tipc_node_check_dest(struct net *net, u32 onode, ...@@ -843,7 +843,7 @@ void tipc_node_check_dest(struct net *net, u32 onode,
memcpy(&le->maddr, maddr, sizeof(*maddr)); memcpy(&le->maddr, maddr, sizeof(*maddr));
exit: exit:
tipc_node_write_unlock(n); 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_link_down(n, b->identity, false);
tipc_node_put(n); tipc_node_put(n);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment