diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-03-18 00:27:03 +0100 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-03-18 14:20:07 +0100 |
commit | 85bc3f38147c5d3fb1eb9ca2236536389b592cae (patch) | |
tree | 1e853e78c883c5a2dcf72e7d432e7ebf6be04973 /net/netfilter | |
parent | f5c511c67aaec323c186543856cfddab31bed1d1 (diff) | |
download | linux-stable-85bc3f38147c5d3fb1eb9ca2236536389b592cae.tar.gz linux-stable-85bc3f38147c5d3fb1eb9ca2236536389b592cae.tar.bz2 linux-stable-85bc3f38147c5d3fb1eb9ca2236536389b592cae.zip |
netfilter: xtables: do not print any messages on ENOMEM
ENOMEM is a very obvious error code (cf. EINVAL), so I think we do not
really need a warning message. Not to mention that if the allocation
fails, the user is most likely going to get a stack trace from slab
already.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/xt_LED.c | 4 | ||||
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 8 | ||||
-rw-r--r-- | net/netfilter/xt_statistic.c | 4 |
3 files changed, 4 insertions, 12 deletions
diff --git a/net/netfilter/xt_LED.c b/net/netfilter/xt_LED.c index f86dc52367b1..0d6c2885ebd6 100644 --- a/net/netfilter/xt_LED.c +++ b/net/netfilter/xt_LED.c @@ -92,10 +92,8 @@ static bool led_tg_check(const struct xt_tgchk_param *par) } ledinternal = kzalloc(sizeof(struct xt_led_info_internal), GFP_KERNEL); - if (!ledinternal) { - printk(KERN_CRIT KBUILD_MODNAME ": out of memory\n"); + if (!ledinternal) return false; - } ledinternal->netfilter_led_trigger.name = ledinfo->id; diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 1fdb50a90f1c..52327c5c1f1d 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c @@ -215,10 +215,8 @@ static int htable_create_v0(struct net *net, struct xt_hashlimit_info *minfo, u_ /* FIXME: don't use vmalloc() here or anywhere else -HW */ hinfo = vmalloc(sizeof(struct xt_hashlimit_htable) + sizeof(struct list_head) * size); - if (!hinfo) { - printk(KERN_ERR "xt_hashlimit: unable to create hashtable\n"); + if (!hinfo) return -1; - } minfo->hinfo = hinfo; /* copy match config into hashtable config */ @@ -288,10 +286,8 @@ static int htable_create(struct net *net, struct xt_hashlimit_mtinfo1 *minfo, /* FIXME: don't use vmalloc() here or anywhere else -HW */ hinfo = vmalloc(sizeof(struct xt_hashlimit_htable) + sizeof(struct list_head) * size); - if (hinfo == NULL) { - printk(KERN_ERR "xt_hashlimit: unable to create hashtable\n"); + if (hinfo == NULL) return -1; - } minfo->hinfo = hinfo; /* copy match config into hashtable config */ diff --git a/net/netfilter/xt_statistic.c b/net/netfilter/xt_statistic.c index d8c0f8f1a78e..51ac1bbb4f52 100644 --- a/net/netfilter/xt_statistic.c +++ b/net/netfilter/xt_statistic.c @@ -61,10 +61,8 @@ static bool statistic_mt_check(const struct xt_mtchk_param *par) return false; info->master = kzalloc(sizeof(*info->master), GFP_KERNEL); - if (info->master == NULL) { - printk(KERN_ERR KBUILD_MODNAME ": Out of memory\n"); + if (info->master == NULL) return false; - } info->master->count = info->u.nth.count; return true; |