summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/tipc/bcast.c4
-rw-r--r--net/tipc/link.c7
2 files changed, 4 insertions, 7 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 08e3216a33d..fa68d1e9ff4 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -407,9 +407,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf)
spin_lock_bh(&bc_lock);
res = tipc_link_send_buf(bcl, buf);
- if (unlikely(res == -ELINKCONG))
- buf_discard(buf);
- else
+ if (likely(res > 0))
bclink_set_last_sent();
bcl->stats.queue_sz_counts++;
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 02b083e5c21..2a9f44a203e 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -864,8 +864,9 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf)
if (unlikely(queue_size >= queue_limit)) {
if (imp <= TIPC_CRITICAL_IMPORTANCE) {
- return link_schedule_port(l_ptr, msg_origport(msg),
- size);
+ link_schedule_port(l_ptr, msg_origport(msg), size);
+ buf_discard(buf);
+ return -ELINKCONG;
}
buf_discard(buf);
if (imp > CONN_MANAGER) {
@@ -1069,8 +1070,6 @@ again:
if (likely(buf)) {
res = link_send_buf_fast(l_ptr, buf,
&sender->max_pkt);
- if (unlikely(res < 0))
- buf_discard(buf);
exit:
tipc_node_unlock(node);
read_unlock_bh(&tipc_net_lock);