tipc: make tipc_link_send_sections_fast exit earlier
authorYing Xue <ying.xue@windriver.com>
Mon, 17 Jun 2013 14:54:49 +0000 (10:54 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jun 2013 22:53:01 +0000 (15:53 -0700)
Once message build request function returns invalid code, the
process of sending message cannot continue. So in case of message
build failure, tipc_link_send_sections_fast() should return
immediately.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c

index b6de1aa059f4e31becabd241253aec8e86ec3b9d..b6ffa9fab2447324dfd4edddbf2d6b5c2df44411 100644 (file)
@@ -1082,6 +1082,9 @@ again:
         */
        res = tipc_msg_build(hdr, msg_sect, num_sect, total_len,
                             sender->max_pkt, &buf);
+       /* Exit if build request was invalid */
+       if (unlikely(res < 0))
+               return res;
 
        read_lock_bh(&tipc_net_lock);
        node = tipc_node_find(destaddr);
@@ -1098,10 +1101,6 @@ exit:
                                return res;
                        }
 
-                       /* Exit if build request was invalid */
-                       if (unlikely(res < 0))
-                               goto exit;
-
                        /* Exit if link (or bearer) is congested */
                        if (link_congested(l_ptr) ||
                            tipc_bearer_blocked(l_ptr->b_ptr)) {