netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart De Schuymer <bdschuym@pandora.be>
To: Changli Gao <xiaosuo@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, bridge@lists.linux-foundation.org
Subject: Re: [Bridge] [PATCH v2] bridge: netfilter: fix a memory leak
Date: Mon, 23 Aug 2010 21:33:48 +0200	[thread overview]
Message-ID: <4C72CD1C.7020901@pandora.be> (raw)
In-Reply-To: <1282539806-25496-1-git-send-email-xiaosuo@gmail.com>

Looks correct to me.

Signed-off-by: Bart De Schuymer <bdschuym@pandora.be>

Changli Gao schreef:
> nf_bridge_alloc() always reset the skb->nf_bridge, so we should always
> put the old one.
>
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> ---
> v2: Should init tmp->use again because memcpy() overwrite it.
>  1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
> index 2c911c0..5ed00bd 100644
> --- a/net/bridge/br_netfilter.c
> +++ b/net/bridge/br_netfilter.c
> @@ -162,8 +162,8 @@ static inline struct nf_bridge_info *nf_bridge_unshare(struct sk_buff *skb)
>  		if (tmp) {
>  			memcpy(tmp, nf_bridge, sizeof(struct nf_bridge_info));
>  			atomic_set(&tmp->use, 1);
> -			nf_bridge_put(nf_bridge);
>  		}
> +		nf_bridge_put(nf_bridge);
>  		nf_bridge = tmp;
>  	}
>  	return nf_bridge;
> _______________________________________________
> Bridge mailing list
> Bridge@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/bridge
>
>   


-- 
Bart De Schuymer
www.artinalgorithms.be


  reply	other threads:[~2010-08-23 19:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-23  5:03 [PATCH v2] bridge: netfilter: fix a memory leak Changli Gao
2010-08-23 19:33 ` Bart De Schuymer [this message]
2010-08-24  3:15   ` [Bridge] " 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=4C72CD1C.7020901@pandora.be \
    --to=bdschuym@pandora.be \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=xiaosuo@gmail.com \
    /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).