X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=net%2Ftipc%2Fnode_subscr.c;h=8ecbd0fb6103442712626899ee59edc6470ee0e2;hb=c83dbf687f1e0f6eccb96cd08438285e280a3876;hp=cff4068cc755295c8fa2708abb8bdeac93d97d82;hpb=d04cdb64212eb5ae6a98026a97dda626e40e8e9a;p=linux-2.6-omap-h63xx.git diff --git a/net/tipc/node_subscr.c b/net/tipc/node_subscr.c index cff4068cc75..8ecbd0fb610 100644 --- a/net/tipc/node_subscr.c +++ b/net/tipc/node_subscr.c @@ -1,6 +1,6 @@ /* * net/tipc/node_subscr.c: TIPC "node down" subscription handling - * + * * Copyright (c) 1995-2006, Ericsson AB * Copyright (c) 2005, Wind River Systems * All rights reserved. @@ -44,21 +44,22 @@ * tipc_nodesub_subscribe - create "node down" subscription for specified node */ -void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, +void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, void *usr_handle, net_ev_handler handle_down) { - node_sub->node = NULL; - if (addr == tipc_own_addr) - return; - if (!tipc_addr_node_valid(addr)) { - warn("node_subscr with illegal %x\n", addr); + if (addr == tipc_own_addr) { + node_sub->node = NULL; return; } + node_sub->node = tipc_node_find(addr); + if (!node_sub->node) { + warn("Node subscription rejected, unknown node 0x%x\n", addr); + return; + } node_sub->handle_node_down = handle_down; node_sub->usr_handle = usr_handle; - node_sub->node = tipc_node_find(addr); - assert(node_sub->node); + tipc_node_lock(node_sub->node); list_add_tail(&node_sub->nodesub_list, &node_sub->node->nsub); tipc_node_unlock(node_sub->node);