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)
downloadkernel_goldelico_gta04-bebc55aeffa72d8198e5c54cab9973a30e92f854.zip
kernel_goldelico_gta04-bebc55aeffa72d8198e5c54cab9973a30e92f854.tar.gz
kernel_goldelico_gta04-bebc55aeffa72d8198e5c54cab9973a30e92f854.tar.bz2
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 08e3216..fa68d1e 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++;