aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/bcast.c
diff options
context:
space:
mode:
authorAllan Stephens <allan.stephens@windriver.com>2011-04-19 10:17:58 -0400
committerPaul Gortmaker <paul.gortmaker@windriver.com>2011-05-10 16:03:53 -0400
commitbebc55aeffa72d8198e5c54cab9973a30e92f854 (patch)
treefe7ec71280dd2ec218e831b5849e89a8d7dc37bc /net/tipc/bcast.c
parent7f47f5c751c93f2ca9e7f0ef6c0915162ac9e076 (diff)
tipc: Fix sk_buff leaks when link congestion is detected
Modifies a TIPC send routine that did not discard the outgoing sk_buff if it was not transmitted because of link congestion; this eliminates the potential for buffer leakage in the many callers who did not clean up the unsent buffer. (The two routines that previously did discard the unsent buffer have been updated to eliminate their now-redundant clean up.) Signed-off-by: Allan Stephens <allan.stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'net/tipc/bcast.c')
-rw-r--r--net/tipc/bcast.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
index 08e3216a33d2..fa68d1e9ff4b 100644
--- a/net/tipc/bcast.c
+++ b/net/tipc/bcast.c
@@ -407,9 +407,7 @@ int tipc_bclink_send_msg(struct sk_buff *buf)
407 spin_lock_bh(&bc_lock); 407 spin_lock_bh(&bc_lock);
408 408
409 res = tipc_link_send_buf(bcl, buf); 409 res = tipc_link_send_buf(bcl, buf);
410 if (unlikely(res == -ELINKCONG)) 410 if (likely(res > 0))
411 buf_discard(buf);
412 else
413 bclink_set_last_sent(); 411 bclink_set_last_sent();
414 412
415 bcl->stats.queue_sz_counts++; 413 bcl->stats.queue_sz_counts++;