Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7410f967 authored by Ying Xue's avatar Ying Xue Committed by David S. Miller
Browse files

tipc: make tipc_link_send_sections_fast exit earlier



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: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 796c75d0
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -1082,6 +1082,9 @@ int tipc_link_send_sections_fast(struct tipc_port *sender,
	 */
	 */
	res = tipc_msg_build(hdr, msg_sect, num_sect, total_len,
	res = tipc_msg_build(hdr, msg_sect, num_sect, total_len,
			     sender->max_pkt, &buf);
			     sender->max_pkt, &buf);
	/* Exit if build request was invalid */
	if (unlikely(res < 0))
		return res;


	read_lock_bh(&tipc_net_lock);
	read_lock_bh(&tipc_net_lock);
	node = tipc_node_find(destaddr);
	node = tipc_node_find(destaddr);
@@ -1098,10 +1101,6 @@ int tipc_link_send_sections_fast(struct tipc_port *sender,
				return res;
				return res;
			}
			}


			/* Exit if build request was invalid */
			if (unlikely(res < 0))
				goto exit;

			/* Exit if link (or bearer) is congested */
			/* Exit if link (or bearer) is congested */
			if (link_congested(l_ptr) ||
			if (link_congested(l_ptr) ||
			    tipc_bearer_blocked(l_ptr->b_ptr)) {
			    tipc_bearer_blocked(l_ptr->b_ptr)) {