summaryrefslogtreecommitdiffstats
path: root/net/tipc/discover.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2008-05-21 23:53:34 +0200
committerDavid S. Miller <davem@davemloft.net>2008-05-21 23:53:34 +0200
commit811102ca23dfdde5ee8b782b3a4bbff44c499cb2 (patch)
tree5572b81137018dc0ce931f6fcea46e0e090b762e /net/tipc/discover.c
parenttipc: Prevent node object duplication due to simultaneous discovery (diff)
downloadlinux-811102ca23dfdde5ee8b782b3a4bbff44c499cb2.tar.xz
linux-811102ca23dfdde5ee8b782b3a4bbff44c499cb2.zip
tipc: Optimize null pointer check during neighbor discovery
This patch optimizes TIPC neighbor discovery code to avoid testing for a null node pointer when the pointer is already known to be non-null. Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--net/tipc/discover.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/tipc/discover.c b/net/tipc/discover.c
index 5d643e5721eb..faeaf06d377e 100644
--- a/net/tipc/discover.c
+++ b/net/tipc/discover.c
@@ -200,9 +200,8 @@ void tipc_disc_recv_msg(struct sk_buff *buf)
dbg(" in own cluster\n");
if (n_ptr == NULL) {
n_ptr = tipc_node_create(orig);
- }
- if (n_ptr == NULL) {
- return;
+ if (!n_ptr)
+ return;
}
spin_lock_bh(&n_ptr->lock);
link = n_ptr->links[b_ptr->identity];