netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ying Xue <ying.xue@windriver.com>
To: Jon Maloy <jon.maloy@ericsson.com>, <davem@davemloft.net>
Cc: netdev@vger.kernel.org, tipc-discussion@lists.sourceforge.net,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: Re: [PATCH net-next 1/1] tipc: fix a memleak when sending data
Date: Mon, 7 Jul 2014 11:28:34 +0800	[thread overview]
Message-ID: <53BA13E2.6060800@windriver.com> (raw)
In-Reply-To: <1404693530-2531-1-git-send-email-jon.maloy@ericsson.com>

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

  reply	other threads:[~2014-07-07  3:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2014-07-08 23:10 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53BA13E2.6060800@windriver.com \
    --to=ying.xue@windriver.com \
    --cc=davem@davemloft.net \
    --cc=jon.maloy@ericsson.com \
    --cc=netdev@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).