Skip to content

Commit

Permalink
netfilter: xt_CT: fix error value in xt_ct_tg_check()
Browse files Browse the repository at this point in the history
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 <eric@regit.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Eric Leblond authored and Pablo Neira Ayuso committed Jan 3, 2014
1 parent dcd93ed commit 14abfa1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/netfilter/xt_CT.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 14abfa1

Please sign in to comment.