diff --git a/net/tipc/link.c b/net/tipc/link.c index 284d6383ad6c..d1a764b9b2d8 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1020,12 +1020,9 @@ int tipc_link_iovec_xmit_fast(struct tipc_port *sender, read_unlock_bh(&tipc_net_lock); /* Couldn't find a link to the destination node */ - if (buf) - return tipc_reject_msg(buf, TIPC_ERR_NO_NODE); - if (res >= 0) - return tipc_port_iovec_reject(sender, hdr, msg_sect, len, - TIPC_ERR_NO_NODE); - return res; + kfree_skb(buf); + tipc_port_iovec_reject(sender, hdr, msg_sect, len, TIPC_ERR_NO_NODE); + return -ENETUNREACH; } /* @@ -1163,8 +1160,9 @@ static int tipc_link_iovec_long_xmit(struct tipc_port *sender, } else { reject: kfree_skb_list(buf_chain); - return tipc_port_iovec_reject(sender, hdr, msg_sect, - len, TIPC_ERR_NO_NODE); + tipc_port_iovec_reject(sender, hdr, msg_sect, len, + TIPC_ERR_NO_NODE); + return -ENETUNREACH; } /* Append chain of fragments to send queue & send them */