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

* Re: [PATCH net-next 1/1] tipc: fix a memleak when sending data
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Ying Xue @ 2014-07-07  3:28 UTC (permalink / raw)
  To: Jon Maloy, davem; +Cc: netdev, tipc-discussion, Paul Gortmaker

On 07/07/2014 08:38 AM, Jon Maloy wrote:
> 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>

Acked-by: Ying Xue <ying.xue@windriver.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)
> 


------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft

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

* Re: [PATCH net-next 1/1] tipc: fix a memleak when sending data
  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
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2014-07-08 23:10 UTC (permalink / raw)
  To: jon.maloy
  Cc: netdev, paul.gortmaker, erik.hugne, ying.xue, maloy,
	tipc-discussion

From: Jon Maloy <jon.maloy@ericsson.com>
Date: Sun,  6 Jul 2014 20:38:50 -0400

> 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>

Applied, thank you.

^ permalink raw reply	[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).