]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
xt_SYSRQ: do not print error messages on ENOMEM
authorJan Engelhardt <jengelh@medozas.de>
Fri, 26 Mar 2010 22:17:23 +0000 (23:17 +0100)
committerJan Engelhardt <jengelh@medozas.de>
Sun, 4 Apr 2010 22:45:28 +0000 (00:45 +0200)
Memory allocation failures are usually already reported by SLAB and
the ENOMEM error code itself.

extensions/xt_SYSRQ.c
extensions/xt_TEE.c

index ffcb6eea318a73d994a7113ffeb3043959423cfb..1208ae66b0680cb3c95031c955b29167f9ae8749 100644 (file)
@@ -332,23 +332,14 @@ static int __init sysrq_crypto_init(void)
        sysrq_digest_size = crypto_hash_digestsize(sysrq_tfm);
        sysrq_digest = kmalloc(sysrq_digest_size, GFP_KERNEL);
        ret = -ENOMEM;
-       if (sysrq_digest == NULL) {
-               printk(KERN_WARNING KBUILD_MODNAME
-                       ": Cannot allocate digest\n");
+       if (sysrq_digest == NULL)
                goto fail;
-       }
        sysrq_hexdigest = kmalloc(2 * sysrq_digest_size + 1, GFP_KERNEL);
-       if (sysrq_hexdigest == NULL) {
-               printk(KERN_WARNING KBUILD_MODNAME
-                       ": Cannot allocate hexdigest\n");
+       if (sysrq_hexdigest == NULL)
                goto fail;
-       }
        sysrq_digest_password = kmalloc(sizeof(sysrq_password), GFP_KERNEL);
-       if (sysrq_digest_password == NULL) {
-               printk(KERN_WARNING KBUILD_MODNAME
-                       ": Cannot allocate password digest space\n");
+       if (sysrq_digest_password == NULL)
                goto fail;
-       }
        do_gettimeofday(&now);
        sysrq_seqno = now.tv_sec;
        ret = xt_register_targets(sysrq_tg_reg, ARRAY_SIZE(sysrq_tg_reg));
index c9a4bdaf9802235f97345a16a14d62688fec1855..ce25663255de8cb572290216987751cf6a356b3d 100644 (file)
@@ -179,11 +179,8 @@ tee_tg4(struct sk_buff **pskb, const struct xt_target_param *par)
         * --gateway.
         */
        skb = skb_copy(skb, GFP_ATOMIC);
-       if (skb == NULL) {
-               if (net_ratelimit())
-                       pr_debug(KBUILD_MODNAME "copy failed!\n");
+       if (skb == NULL)
                return XT_CONTINUE;
-       }
 
 #ifdef WITH_CONNTRACK
        /*