xt_SYSRQ: do not print error messages on ENOMEM

Memory allocation failures are usually already reported by SLAB and
the ENOMEM error code itself.
This commit is contained in:
Jan Engelhardt
2010-03-26 23:17:23 +01:00
parent 02d8bdc3d9
commit dd8fdd09c8
2 changed files with 4 additions and 16 deletions

View 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));

View 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
/*