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 <richard.alpe@ericsson.com> Acked-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Erik Hugne <erik.hugne@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9b3009604b
commit
2837f39c7c
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user