]> Pileus Git - ~andy/linux/commitdiff
netfilter: xt_CT: fix error value in xt_ct_tg_check()
authorEric Leblond <eric@regit.org>
Thu, 2 Jan 2014 09:03:45 +0000 (10:03 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Fri, 3 Jan 2014 22:41:39 +0000 (23:41 +0100)
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>
net/netfilter/xt_CT.c

index da35ac06a975ded85b76953e4d7eb54c33478b04..5929be622c5cd27b9e706811042c9e176a3c78f7 100644 (file)
@@ -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);