[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C72CD1C.7020901@pandora.be>
Date: Mon, 23 Aug 2010 21:33:48 +0200
From: Bart De Schuymer <bdschuym@...dora.be>
To: Changli Gao <xiaosuo@...il.com>
CC: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
bridge@...ts.linux-foundation.org
Subject: Re: [Bridge] [PATCH v2] bridge: netfilter: fix a memory leak
Looks correct to me.
Signed-off-by: Bart De Schuymer <bdschuym@...dora.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@...il.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@...ts.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/bridge
>
>
--
Bart De Schuymer
www.artinalgorithms.be
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists