Skip to content

Commit

Permalink
tipc: Optimize null pointer check during neighbor discovery
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
ajstephens authored and davem330 committed May 21, 2008
1 parent 2ecb092 commit 811102c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions net/tipc/discover.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 811102c

Please sign in to comment.