From: Eric Leblond Date: Thu, 2 Jan 2014 09:03:45 +0000 (+0100) Subject: netfilter: xt_CT: fix error value in xt_ct_tg_check() X-Git-Tag: v5.15~18574^2~284^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14abfa161d256c60f3ea6ba494704ac634b94f63;p=platform%2Fkernel%2Flinux-starfive.git netfilter: xt_CT: fix error value in xt_ct_tg_check() If setting event mask fails then we were returning 0 for success. This patch updates return code to -EINVAL in case of problem. Signed-off-by: Eric Leblond Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c index da35ac0..5929be6 100644 --- a/net/netfilter/xt_CT.c +++ b/net/netfilter/xt_CT.c @@ -211,8 +211,10 @@ static int xt_ct_tg_check(const struct xt_tgchk_param *par, ret = 0; if ((info->ct_events || info->exp_events) && !nf_ct_ecache_ext_add(ct, info->ct_events, info->exp_events, - GFP_KERNEL)) + GFP_KERNEL)) { + ret = -EINVAL; goto err3; + } if (info->helper[0]) { ret = xt_ct_set_helper(ct, info->helper, par);