netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: xiaosuo@gmail.com
Cc: shemminger@linux-foundation.org,
	bridge@lists.linux-foundation.org, netdev@vger.kernel.org
Subject: Re: [PATCH] bridge: netfilter: fix a memory leak
Date: Sun, 22 Aug 2010 21:36:32 -0700 (PDT)	[thread overview]
Message-ID: <20100822.213632.191389158.davem@davemloft.net> (raw)
In-Reply-To: <1282280596-18992-1-git-send-email-xiaosuo@gmail.com>

From: Changli Gao <xiaosuo@gmail.com>
Date: Fri, 20 Aug 2010 13:03:16 +0800

> nf_bridge_alloc() always reset the skb->nf_bridge, so we should always
> put the old one. skb->nf_bridge->use is initialized in nf_bridge_alloc(),
> so we don't need to initialize it again.
> 
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>

We just memcpy()'d 'nf_bridge' to 'tmp', that why the ->use count is
going to be something other than '1'.  It now has the ->use count that
'nf_bridge' did.

And that is why we must explicitly do atomic_set() on 'tmp'.

  reply	other threads:[~2010-08-23  4:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-20  5:03 [PATCH] bridge: netfilter: fix a memory leak Changli Gao
2010-08-23  4:36 ` David Miller [this message]
2010-08-23  4:40   ` Changli Gao

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=20100822.213632.191389158.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=bridge@lists.linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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).