diff mbox

[nf] netfilter: nft_ct: do cleanup work when NFTA_CT_DIRECTION is invalid

Message ID 1489587728-28318-1-git-send-email-zlpnobody@163.com
State Accepted
Delegated to: Pablo Neira
Headers show

Commit Message

Liping Zhang March 15, 2017, 2:22 p.m. UTC
From: Liping Zhang <zlpnobody@gmail.com>

We should jump to invoke __nft_ct_set_destroy() instead of just
return error.

Fixes: edee4f1e9245 ("netfilter: nft_ct: add zone id set support")
Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
---
 net/netfilter/nft_ct.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Florian Westphal March 15, 2017, 2:52 p.m. UTC | #1
Liping Zhang <zlpnobody@163.com> wrote:
> From: Liping Zhang <zlpnobody@gmail.com>
> 
> We should jump to invoke __nft_ct_set_destroy() instead of just
> return error.
> 
> Fixes: edee4f1e9245 ("netfilter: nft_ct: add zone id set support")
> Signed-off-by: Liping Zhang <zlpnobody@gmail.com>

Indeed, good catch, thanks!

Acked-by: Florian Westphal <fw@strlen.de>
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Pablo Neira Ayuso March 15, 2017, 4:15 p.m. UTC | #2
On Wed, Mar 15, 2017 at 03:52:31PM +0100, Florian Westphal wrote:
> Liping Zhang <zlpnobody@163.com> wrote:
> > From: Liping Zhang <zlpnobody@gmail.com>
> > 
> > We should jump to invoke __nft_ct_set_destroy() instead of just
> > return error.
> > 
> > Fixes: edee4f1e9245 ("netfilter: nft_ct: add zone id set support")
> > Signed-off-by: Liping Zhang <zlpnobody@gmail.com>
> 
> Indeed, good catch, thanks!
> 
> Acked-by: Florian Westphal <fw@strlen.de>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/nft_ct.c b/net/netfilter/nft_ct.c
index 91585b5..0264258 100644
--- a/net/netfilter/nft_ct.c
+++ b/net/netfilter/nft_ct.c
@@ -544,7 +544,8 @@  static int nft_ct_set_init(const struct nft_ctx *ctx,
 		case IP_CT_DIR_REPLY:
 			break;
 		default:
-			return -EINVAL;
+			err = -EINVAL;
+			goto err1;
 		}
 	}