netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/1] tipc: fix a memleak when sending data
@ 2014-07-07  0:38 Jon Maloy
  2014-07-07  3:28 ` Ying Xue
  2014-07-08 23:10 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jon Maloy @ 2014-07-07  0:38 UTC (permalink / raw)
  To: davem
  Cc: netdev, Paul Gortmaker, erik.hugne, ying.xue, maloy,
	tipc-discussion, Jon Maloy

From: Erik Hugne <erik.hugne@ericsson.com>

This fixes a regression bug caused by:
067608e9d019d6477fd45dd948e81af0e5bf599f ("tipc: introduce direct
iovec to buffer chain fragmentation function")

If data is sent on a nonblocking socket and the destination link
is congested, the buffer chain is leaked. We fix this by freeing
the chain in this case.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
---
 net/tipc/socket.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index ede78b1..8c5600c 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -784,8 +784,9 @@ new_mtu:
 			break;
 
 		rc = tipc_wait_for_sndmsg(sock, &timeo);
+		if (rc)
+			kfree_skb_list(buf);
 	} while (!rc);
-
 exit:
 	if (iocb)
 		release_sock(sk);
@@ -898,6 +899,8 @@ next:
 				break;
 		}
 		rc = tipc_wait_for_sndpkt(sock, &timeo);
+		if (rc)
+			kfree_skb_list(buf);
 	} while (!rc);
 exit:
 	if (iocb)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-08 23:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-07  0:38 [PATCH net-next 1/1] tipc: fix a memleak when sending data Jon Maloy
2014-07-07  3:28 ` Ying Xue
2014-07-08 23:10 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).