All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nf 1/1] netfilter: xt_CT: Fix one possible memleak of timeout
@ 2017-04-06 11:04 gfree.wind
  2017-04-06 11:21 ` Gao Feng
  0 siblings, 1 reply; 2+ messages in thread
From: gfree.wind @ 2017-04-06 11:04 UTC (permalink / raw)
  To: pablo, netfilter-devel; +Cc: Gao Feng

From: Gao Feng <fgao@ikuai8.com>

When nf_ct_timeout_ext_add failed in xt_ct_set_timeout, it should
free the timeout refcnt.

Now goto the err_put_timeout error handler instead of going ahead.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 net/netfilter/xt_CT.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index b008db0..3cd812c 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -168,7 +168,7 @@ static void __xt_ct_tg_timeout_put(struct ctnl_timeout *timeout)
 	}
 	timeout_ext = nf_ct_timeout_ext_add(ct, timeout, GFP_ATOMIC);
 	if (timeout_ext == NULL)
-		ret = -ENOMEM;
+		goto err_put_timeout;
 
 	rcu_read_unlock();
 	return ret;
-- 
1.9.1



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

* RE: [PATCH nf 1/1] netfilter: xt_CT: Fix one possible memleak of timeout
  2017-04-06 11:04 [PATCH nf 1/1] netfilter: xt_CT: Fix one possible memleak of timeout gfree.wind
@ 2017-04-06 11:21 ` Gao Feng
  0 siblings, 0 replies; 2+ messages in thread
From: Gao Feng @ 2017-04-06 11:21 UTC (permalink / raw)
  To: gfree.wind, pablo, netfilter-devel

Hi All,

> -----Original Message-----
> From: gfree.wind@foxmail.com [mailto:gfree.wind@foxmail.com]
> Sent: Thursday, April 6, 2017 7:05 PM
> To: pablo@netfilter.org; netfilter-devel@vger.kernel.org
> Cc: Gao Feng <fgao@ikuai8.com>
> Subject: [PATCH nf 1/1] netfilter: xt_CT: Fix one possible memleak of
timeout
> 
> From: Gao Feng <fgao@ikuai8.com>
> 
> When nf_ct_timeout_ext_add failed in xt_ct_set_timeout, it should free the
> timeout refcnt.
> 
> Now goto the err_put_timeout error handler instead of going ahead.
> 
> Signed-off-by: Gao Feng <fgao@ikuai8.com>
> ---
>  net/netfilter/xt_CT.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c index
> b008db0..3cd812c 100644
> --- a/net/netfilter/xt_CT.c
> +++ b/net/netfilter/xt_CT.c
> @@ -168,7 +168,7 @@ static void __xt_ct_tg_timeout_put(struct ctnl_timeout
> *timeout)
>  	}
>  	timeout_ext = nf_ct_timeout_ext_add(ct, timeout, GFP_ATOMIC);
>  	if (timeout_ext == NULL)
> -		ret = -ENOMEM;
> +		goto err_put_timeout;
> 
>  	rcu_read_unlock();
>  	return ret;
> --
> 1.9.1
> 
Sorry, please ignore this patch.
I have sent the v2 patch which keep the -ENOMEM assignment.

Regards
Feng 






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

end of thread, other threads:[~2017-04-06 11:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 11:04 [PATCH nf 1/1] netfilter: xt_CT: Fix one possible memleak of timeout gfree.wind
2017-04-06 11:21 ` Gao Feng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.