netfilter: xtables: slightly better error reporting
[sfrench/cifs-2.6.git] / net / netfilter / xt_statistic.c
index d8c0f8f1a78e3a2c5c6ae96edb94f76258a410cf..8ed2b2905091280a47b0de4b9aba27861a5761d8 100644 (file)
@@ -52,22 +52,20 @@ statistic_mt(const struct sk_buff *skb, const struct xt_match_param *par)
        return ret;
 }
 
-static bool statistic_mt_check(const struct xt_mtchk_param *par)
+static int statistic_mt_check(const struct xt_mtchk_param *par)
 {
        struct xt_statistic_info *info = par->matchinfo;
 
        if (info->mode > XT_STATISTIC_MODE_MAX ||
            info->flags & ~XT_STATISTIC_MASK)
-               return false;
+               return -EINVAL;
 
        info->master = kzalloc(sizeof(*info->master), GFP_KERNEL);
-       if (info->master == NULL) {
-               printk(KERN_ERR KBUILD_MODNAME ": Out of memory\n");
-               return false;
-       }
+       if (info->master == NULL)
+               return -ENOMEM;
        info->master->count = info->u.nth.count;
 
-       return true;
+       return 0;
 }
 
 static void statistic_mt_destroy(const struct xt_mtdtor_param *par)