diff options
author | Joe Perches <joe@perches.com> | 2011-08-29 17:17:25 -0400 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2011-11-01 04:19:49 -0400 |
commit | 0a9ee81349d90c6c85831f38118bf569c60a4d51 (patch) | |
tree | 37c5f232e594cbd222637c8ae44030749467190d | |
parent | 40cb1f9bc52186a1a9ef56f0d976482863516ce1 (diff) |
netfilter: Remove unnecessary OOM logging messages
Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r-- | net/bridge/netfilter/ebt_ulog.c | 7 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_CLUSTERIP.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ULOG.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_snmp_basic.c | 22 | ||||
-rw-r--r-- | net/ipv6/netfilter/nf_conntrack_reasm.c | 7 | ||||
-rw-r--r-- | net/netfilter/ipset/ip_set_core.c | 4 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_core.c | 5 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 18 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_dh.c | 5 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_lblc.c | 9 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_lblcr.c | 13 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_proto.c | 5 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_sh.c | 5 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_wrr.c | 5 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 5 | ||||
-rw-r--r-- | net/netfilter/nfnetlink_log.c | 7 | ||||
-rw-r--r-- | net/netfilter/xt_IDLETIMER.c | 2 | ||||
-rw-r--r-- | net/netfilter/xt_hashlimit.c | 5 |
18 files changed, 37 insertions, 92 deletions
diff --git a/net/bridge/netfilter/ebt_ulog.c b/net/bridge/netfilter/ebt_ulog.c index bf2a333ca7c7..5449294bdd5e 100644 --- a/net/bridge/netfilter/ebt_ulog.c +++ b/net/bridge/netfilter/ebt_ulog.c | |||
@@ -102,16 +102,15 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size) | |||
102 | unsigned int n; | 102 | unsigned int n; |
103 | 103 | ||
104 | n = max(size, nlbufsiz); | 104 | n = max(size, nlbufsiz); |
105 | skb = alloc_skb(n, GFP_ATOMIC); | 105 | skb = alloc_skb(n, GFP_ATOMIC | __GFP_NOWARN); |
106 | if (!skb) { | 106 | if (!skb) { |
107 | pr_debug("cannot alloc whole buffer of size %ub!\n", n); | ||
108 | if (n > size) { | 107 | if (n > size) { |
109 | /* try to allocate only as much as we need for | 108 | /* try to allocate only as much as we need for |
110 | * current packet */ | 109 | * current packet */ |
111 | skb = alloc_skb(size, GFP_ATOMIC); | 110 | skb = alloc_skb(size, GFP_ATOMIC); |
112 | if (!skb) | 111 | if (!skb) |
113 | pr_debug("cannot even allocate " | 112 | pr_debug("cannot even allocate buffer of size %ub\n", |
114 | "buffer of size %ub\n", size); | 113 | size); |
115 | } | 114 | } |
116 | } | 115 | } |
117 | 116 | ||
diff --git a/net/ipv4/netfilter/ipt_CLUSTERIP.c b/net/ipv4/netfilter/ipt_CLUSTERIP.c index db8d22db425f..a639967eb727 100644 --- a/net/ipv4/netfilter/ipt_CLUSTERIP.c +++ b/net/ipv4/netfilter/ipt_CLUSTERIP.c | |||
@@ -395,7 +395,6 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par) | |||
395 | config = clusterip_config_init(cipinfo, | 395 | config = clusterip_config_init(cipinfo, |
396 | e->ip.dst.s_addr, dev); | 396 | e->ip.dst.s_addr, dev); |
397 | if (!config) { | 397 | if (!config) { |
398 | pr_info("cannot allocate config\n"); | ||
399 | dev_put(dev); | 398 | dev_put(dev); |
400 | return -ENOMEM; | 399 | return -ENOMEM; |
401 | } | 400 | } |
diff --git a/net/ipv4/netfilter/ipt_ULOG.c b/net/ipv4/netfilter/ipt_ULOG.c index 446e0f467a17..b5508151e547 100644 --- a/net/ipv4/netfilter/ipt_ULOG.c +++ b/net/ipv4/netfilter/ipt_ULOG.c | |||
@@ -135,10 +135,8 @@ static struct sk_buff *ulog_alloc_skb(unsigned int size) | |||
135 | * due to slab allocator restrictions */ | 135 | * due to slab allocator restrictions */ |
136 | 136 | ||
137 | n = max(size, nlbufsiz); | 137 | n = max(size, nlbufsiz); |
138 | skb = alloc_skb(n, GFP_ATOMIC); | 138 | skb = alloc_skb(n, GFP_ATOMIC | __GFP_NOWARN); |
139 | if (!skb) { | 139 | if (!skb) { |
140 | pr_debug("cannot alloc whole buffer %ub!\n", n); | ||
141 | |||
142 | if (n > size) { | 140 | if (n > size) { |
143 | /* try to allocate only as much as we need for | 141 | /* try to allocate only as much as we need for |
144 | * current packet */ | 142 | * current packet */ |
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index d1cb412c18e0..2133c30a4a5f 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c | |||
@@ -400,11 +400,8 @@ static unsigned char asn1_octets_decode(struct asn1_ctx *ctx, | |||
400 | *len = 0; | 400 | *len = 0; |
401 | 401 | ||
402 | *octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC); | 402 | *octets = kmalloc(eoc - ctx->pointer, GFP_ATOMIC); |
403 | if (*octets == NULL) { | 403 | if (*octets == NULL) |
404 | if (net_ratelimit()) | ||
405 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
406 | return 0; | 404 | return 0; |
407 | } | ||
408 | 405 | ||
409 | ptr = *octets; | 406 | ptr = *octets; |
410 | while (ctx->pointer < eoc) { | 407 | while (ctx->pointer < eoc) { |
@@ -451,11 +448,8 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx, | |||
451 | return 0; | 448 | return 0; |
452 | 449 | ||
453 | *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC); | 450 | *oid = kmalloc(size * sizeof(unsigned long), GFP_ATOMIC); |
454 | if (*oid == NULL) { | 451 | if (*oid == NULL) |
455 | if (net_ratelimit()) | ||
456 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
457 | return 0; | 452 | return 0; |
458 | } | ||
459 | 453 | ||
460 | optr = *oid; | 454 | optr = *oid; |
461 | 455 | ||
@@ -728,8 +722,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
728 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); | 722 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); |
729 | if (*obj == NULL) { | 723 | if (*obj == NULL) { |
730 | kfree(id); | 724 | kfree(id); |
731 | if (net_ratelimit()) | ||
732 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
733 | return 0; | 725 | return 0; |
734 | } | 726 | } |
735 | (*obj)->syntax.l[0] = l; | 727 | (*obj)->syntax.l[0] = l; |
@@ -744,8 +736,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
744 | if (*obj == NULL) { | 736 | if (*obj == NULL) { |
745 | kfree(p); | 737 | kfree(p); |
746 | kfree(id); | 738 | kfree(id); |
747 | if (net_ratelimit()) | ||
748 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
749 | return 0; | 739 | return 0; |
750 | } | 740 | } |
751 | memcpy((*obj)->syntax.c, p, len); | 741 | memcpy((*obj)->syntax.c, p, len); |
@@ -759,8 +749,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
759 | *obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC); | 749 | *obj = kmalloc(sizeof(struct snmp_object), GFP_ATOMIC); |
760 | if (*obj == NULL) { | 750 | if (*obj == NULL) { |
761 | kfree(id); | 751 | kfree(id); |
762 | if (net_ratelimit()) | ||
763 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
764 | return 0; | 752 | return 0; |
765 | } | 753 | } |
766 | if (!asn1_null_decode(ctx, end)) { | 754 | if (!asn1_null_decode(ctx, end)) { |
@@ -780,8 +768,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
780 | if (*obj == NULL) { | 768 | if (*obj == NULL) { |
781 | kfree(lp); | 769 | kfree(lp); |
782 | kfree(id); | 770 | kfree(id); |
783 | if (net_ratelimit()) | ||
784 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
785 | return 0; | 771 | return 0; |
786 | } | 772 | } |
787 | memcpy((*obj)->syntax.ul, lp, len); | 773 | memcpy((*obj)->syntax.ul, lp, len); |
@@ -801,8 +787,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
801 | if (*obj == NULL) { | 787 | if (*obj == NULL) { |
802 | kfree(p); | 788 | kfree(p); |
803 | kfree(id); | 789 | kfree(id); |
804 | if (net_ratelimit()) | ||
805 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
806 | return 0; | 790 | return 0; |
807 | } | 791 | } |
808 | memcpy((*obj)->syntax.uc, p, len); | 792 | memcpy((*obj)->syntax.uc, p, len); |
@@ -819,8 +803,6 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
819 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); | 803 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); |
820 | if (*obj == NULL) { | 804 | if (*obj == NULL) { |
821 | kfree(id); | 805 | kfree(id); |
822 | if (net_ratelimit()) | ||
823 | pr_notice("OOM in bsalg (%d)\n", __LINE__); | ||
824 | return 0; | 806 | return 0; |
825 | } | 807 | } |
826 | (*obj)->syntax.ul[0] = ul; | 808 | (*obj)->syntax.ul[0] = ul; |
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c index e8762c73b170..38f00b0298d3 100644 --- a/net/ipv6/netfilter/nf_conntrack_reasm.c +++ b/net/ipv6/netfilter/nf_conntrack_reasm.c | |||
@@ -182,7 +182,6 @@ fq_find(__be32 id, u32 user, struct in6_addr *src, struct in6_addr *dst) | |||
182 | return container_of(q, struct nf_ct_frag6_queue, q); | 182 | return container_of(q, struct nf_ct_frag6_queue, q); |
183 | 183 | ||
184 | oom: | 184 | oom: |
185 | pr_debug("Can't alloc new queue\n"); | ||
186 | return NULL; | 185 | return NULL; |
187 | } | 186 | } |
188 | 187 | ||
@@ -370,10 +369,10 @@ nf_ct_frag6_reasm(struct nf_ct_frag6_queue *fq, struct net_device *dev) | |||
370 | struct sk_buff *clone; | 369 | struct sk_buff *clone; |
371 | int i, plen = 0; | 370 | int i, plen = 0; |
372 | 371 | ||
373 | if ((clone = alloc_skb(0, GFP_ATOMIC)) == NULL) { | 372 | clone = alloc_skb(0, GFP_ATOMIC); |
374 | pr_debug("Can't alloc skb\n"); | 373 | if (clone == NULL) |
375 | goto out_oom; | 374 | goto out_oom; |
376 | } | 375 | |
377 | clone->next = head->next; | 376 | clone->next = head->next; |
378 | head->next = clone; | 377 | head->next = clone; |
379 | skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; | 378 | skb_shinfo(clone)->frag_list = skb_shinfo(head)->frag_list; |
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c index d7e86ef9d23a..86137b558f45 100644 --- a/net/netfilter/ipset/ip_set_core.c +++ b/net/netfilter/ipset/ip_set_core.c | |||
@@ -1699,10 +1699,8 @@ ip_set_init(void) | |||
1699 | 1699 | ||
1700 | ip_set_list = kzalloc(sizeof(struct ip_set *) * ip_set_max, | 1700 | ip_set_list = kzalloc(sizeof(struct ip_set *) * ip_set_max, |
1701 | GFP_KERNEL); | 1701 | GFP_KERNEL); |
1702 | if (!ip_set_list) { | 1702 | if (!ip_set_list) |
1703 | pr_err("ip_set: Unable to create ip_set_list\n"); | ||
1704 | return -ENOMEM; | 1703 | return -ENOMEM; |
1705 | } | ||
1706 | 1704 | ||
1707 | ret = nfnetlink_subsys_register(&ip_set_netlink_subsys); | 1705 | ret = nfnetlink_subsys_register(&ip_set_netlink_subsys); |
1708 | if (ret != 0) { | 1706 | if (ret != 0) { |
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index 00ea1ad00c04..46a8130d3f42 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
@@ -1877,10 +1877,9 @@ static int __net_init __ip_vs_init(struct net *net) | |||
1877 | struct netns_ipvs *ipvs; | 1877 | struct netns_ipvs *ipvs; |
1878 | 1878 | ||
1879 | ipvs = net_generic(net, ip_vs_net_id); | 1879 | ipvs = net_generic(net, ip_vs_net_id); |
1880 | if (ipvs == NULL) { | 1880 | if (ipvs == NULL) |
1881 | pr_err("%s(): no memory.\n", __func__); | ||
1882 | return -ENOMEM; | 1881 | return -ENOMEM; |
1883 | } | 1882 | |
1884 | /* Hold the beast until a service is registerd */ | 1883 | /* Hold the beast until a service is registerd */ |
1885 | ipvs->enable = 0; | 1884 | ipvs->enable = 0; |
1886 | ipvs->net = net; | 1885 | ipvs->net = net; |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 993935c0e472..008bf97cc91a 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -856,15 +856,12 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest, | |||
856 | } | 856 | } |
857 | 857 | ||
858 | dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL); | 858 | dest = kzalloc(sizeof(struct ip_vs_dest), GFP_KERNEL); |
859 | if (dest == NULL) { | 859 | if (dest == NULL) |
860 | pr_err("%s(): no memory.\n", __func__); | ||
861 | return -ENOMEM; | 860 | return -ENOMEM; |
862 | } | 861 | |
863 | dest->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); | 862 | dest->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); |
864 | if (!dest->stats.cpustats) { | 863 | if (!dest->stats.cpustats) |
865 | pr_err("%s() alloc_percpu failed\n", __func__); | ||
866 | goto err_alloc; | 864 | goto err_alloc; |
867 | } | ||
868 | 865 | ||
869 | dest->af = svc->af; | 866 | dest->af = svc->af; |
870 | dest->protocol = svc->protocol; | 867 | dest->protocol = svc->protocol; |
@@ -1168,10 +1165,8 @@ ip_vs_add_service(struct net *net, struct ip_vs_service_user_kern *u, | |||
1168 | goto out_err; | 1165 | goto out_err; |
1169 | } | 1166 | } |
1170 | svc->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); | 1167 | svc->stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); |
1171 | if (!svc->stats.cpustats) { | 1168 | if (!svc->stats.cpustats) |
1172 | pr_err("%s() alloc_percpu failed\n", __func__); | ||
1173 | goto out_err; | 1169 | goto out_err; |
1174 | } | ||
1175 | 1170 | ||
1176 | /* I'm the first user of the service */ | 1171 | /* I'm the first user of the service */ |
1177 | atomic_set(&svc->usecnt, 0); | 1172 | atomic_set(&svc->usecnt, 0); |
@@ -3716,10 +3711,9 @@ int __net_init ip_vs_control_net_init(struct net *net) | |||
3716 | 3711 | ||
3717 | /* procfs stats */ | 3712 | /* procfs stats */ |
3718 | ipvs->tot_stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); | 3713 | ipvs->tot_stats.cpustats = alloc_percpu(struct ip_vs_cpu_stats); |
3719 | if (!ipvs->tot_stats.cpustats) { | 3714 | if (!ipvs->tot_stats.cpustats) |
3720 | pr_err("%s(): alloc_percpu.\n", __func__); | ||
3721 | return -ENOMEM; | 3715 | return -ENOMEM; |
3722 | } | 3716 | |
3723 | spin_lock_init(&ipvs->tot_stats.lock); | 3717 | spin_lock_init(&ipvs->tot_stats.lock); |
3724 | 3718 | ||
3725 | proc_net_fops_create(net, "ip_vs", 0, &ip_vs_info_fops); | 3719 | proc_net_fops_create(net, "ip_vs", 0, &ip_vs_info_fops); |
diff --git a/net/netfilter/ipvs/ip_vs_dh.c b/net/netfilter/ipvs/ip_vs_dh.c index 95fd0d14200b..1c269e56200a 100644 --- a/net/netfilter/ipvs/ip_vs_dh.c +++ b/net/netfilter/ipvs/ip_vs_dh.c | |||
@@ -150,10 +150,9 @@ static int ip_vs_dh_init_svc(struct ip_vs_service *svc) | |||
150 | /* allocate the DH table for this service */ | 150 | /* allocate the DH table for this service */ |
151 | tbl = kmalloc(sizeof(struct ip_vs_dh_bucket)*IP_VS_DH_TAB_SIZE, | 151 | tbl = kmalloc(sizeof(struct ip_vs_dh_bucket)*IP_VS_DH_TAB_SIZE, |
152 | GFP_ATOMIC); | 152 | GFP_ATOMIC); |
153 | if (tbl == NULL) { | 153 | if (tbl == NULL) |
154 | pr_err("%s(): no memory\n", __func__); | ||
155 | return -ENOMEM; | 154 | return -ENOMEM; |
156 | } | 155 | |
157 | svc->sched_data = tbl; | 156 | svc->sched_data = tbl; |
158 | IP_VS_DBG(6, "DH hash table (memory=%Zdbytes) allocated for " | 157 | IP_VS_DBG(6, "DH hash table (memory=%Zdbytes) allocated for " |
159 | "current service\n", | 158 | "current service\n", |
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c index 87e40ea77a95..0f16283fd058 100644 --- a/net/netfilter/ipvs/ip_vs_lblc.c +++ b/net/netfilter/ipvs/ip_vs_lblc.c | |||
@@ -202,10 +202,8 @@ ip_vs_lblc_new(struct ip_vs_lblc_table *tbl, const union nf_inet_addr *daddr, | |||
202 | en = ip_vs_lblc_get(dest->af, tbl, daddr); | 202 | en = ip_vs_lblc_get(dest->af, tbl, daddr); |
203 | if (!en) { | 203 | if (!en) { |
204 | en = kmalloc(sizeof(*en), GFP_ATOMIC); | 204 | en = kmalloc(sizeof(*en), GFP_ATOMIC); |
205 | if (!en) { | 205 | if (!en) |
206 | pr_err("%s(): no memory\n", __func__); | ||
207 | return NULL; | 206 | return NULL; |
208 | } | ||
209 | 207 | ||
210 | en->af = dest->af; | 208 | en->af = dest->af; |
211 | ip_vs_addr_copy(dest->af, &en->addr, daddr); | 209 | ip_vs_addr_copy(dest->af, &en->addr, daddr); |
@@ -345,10 +343,9 @@ static int ip_vs_lblc_init_svc(struct ip_vs_service *svc) | |||
345 | * Allocate the ip_vs_lblc_table for this service | 343 | * Allocate the ip_vs_lblc_table for this service |
346 | */ | 344 | */ |
347 | tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC); | 345 | tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC); |
348 | if (tbl == NULL) { | 346 | if (tbl == NULL) |
349 | pr_err("%s(): no memory\n", __func__); | ||
350 | return -ENOMEM; | 347 | return -ENOMEM; |
351 | } | 348 | |
352 | svc->sched_data = tbl; | 349 | svc->sched_data = tbl; |
353 | IP_VS_DBG(6, "LBLC hash table (memory=%Zdbytes) allocated for " | 350 | IP_VS_DBG(6, "LBLC hash table (memory=%Zdbytes) allocated for " |
354 | "current service\n", sizeof(*tbl)); | 351 | "current service\n", sizeof(*tbl)); |
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c index 90f618ab6dda..eec797f8cce7 100644 --- a/net/netfilter/ipvs/ip_vs_lblcr.c +++ b/net/netfilter/ipvs/ip_vs_lblcr.c | |||
@@ -112,10 +112,8 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest) | |||
112 | } | 112 | } |
113 | 113 | ||
114 | e = kmalloc(sizeof(*e), GFP_ATOMIC); | 114 | e = kmalloc(sizeof(*e), GFP_ATOMIC); |
115 | if (e == NULL) { | 115 | if (e == NULL) |
116 | pr_err("%s(): no memory\n", __func__); | ||
117 | return NULL; | 116 | return NULL; |
118 | } | ||
119 | 117 | ||
120 | atomic_inc(&dest->refcnt); | 118 | atomic_inc(&dest->refcnt); |
121 | e->dest = dest; | 119 | e->dest = dest; |
@@ -373,10 +371,8 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr, | |||
373 | en = ip_vs_lblcr_get(dest->af, tbl, daddr); | 371 | en = ip_vs_lblcr_get(dest->af, tbl, daddr); |
374 | if (!en) { | 372 | if (!en) { |
375 | en = kmalloc(sizeof(*en), GFP_ATOMIC); | 373 | en = kmalloc(sizeof(*en), GFP_ATOMIC); |
376 | if (!en) { | 374 | if (!en) |
377 | pr_err("%s(): no memory\n", __func__); | ||
378 | return NULL; | 375 | return NULL; |
379 | } | ||
380 | 376 | ||
381 | en->af = dest->af; | 377 | en->af = dest->af; |
382 | ip_vs_addr_copy(dest->af, &en->addr, daddr); | 378 | ip_vs_addr_copy(dest->af, &en->addr, daddr); |
@@ -516,10 +512,9 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc) | |||
516 | * Allocate the ip_vs_lblcr_table for this service | 512 | * Allocate the ip_vs_lblcr_table for this service |
517 | */ | 513 | */ |
518 | tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC); | 514 | tbl = kmalloc(sizeof(*tbl), GFP_ATOMIC); |
519 | if (tbl == NULL) { | 515 | if (tbl == NULL) |
520 | pr_err("%s(): no memory\n", __func__); | ||
521 | return -ENOMEM; | 516 | return -ENOMEM; |
522 | } | 517 | |
523 | svc->sched_data = tbl; | 518 | svc->sched_data = tbl; |
524 | IP_VS_DBG(6, "LBLCR hash table (memory=%Zdbytes) allocated for " | 519 | IP_VS_DBG(6, "LBLCR hash table (memory=%Zdbytes) allocated for " |
525 | "current service\n", sizeof(*tbl)); | 520 | "current service\n", sizeof(*tbl)); |
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c index 52d073c105e9..85312939695f 100644 --- a/net/netfilter/ipvs/ip_vs_proto.c +++ b/net/netfilter/ipvs/ip_vs_proto.c | |||
@@ -74,10 +74,9 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp) | |||
74 | struct ip_vs_proto_data *pd = | 74 | struct ip_vs_proto_data *pd = |
75 | kzalloc(sizeof(struct ip_vs_proto_data), GFP_ATOMIC); | 75 | kzalloc(sizeof(struct ip_vs_proto_data), GFP_ATOMIC); |
76 | 76 | ||
77 | if (!pd) { | 77 | if (!pd) |
78 | pr_err("%s(): no memory.\n", __func__); | ||
79 | return -ENOMEM; | 78 | return -ENOMEM; |
80 | } | 79 | |
81 | pd->pp = pp; /* For speed issues */ | 80 | pd->pp = pp; /* For speed issues */ |
82 | pd->next = ipvs->proto_data_table[hash]; | 81 | pd->next = ipvs->proto_data_table[hash]; |
83 | ipvs->proto_data_table[hash] = pd; | 82 | ipvs->proto_data_table[hash] = pd; |
diff --git a/net/netfilter/ipvs/ip_vs_sh.c b/net/netfilter/ipvs/ip_vs_sh.c index b5e2556c581a..33815f4fb451 100644 --- a/net/netfilter/ipvs/ip_vs_sh.c +++ b/net/netfilter/ipvs/ip_vs_sh.c | |||
@@ -147,10 +147,9 @@ static int ip_vs_sh_init_svc(struct ip_vs_service *svc) | |||
147 | /* allocate the SH table for this service */ | 147 | /* allocate the SH table for this service */ |
148 | tbl = kmalloc(sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE, | 148 | tbl = kmalloc(sizeof(struct ip_vs_sh_bucket)*IP_VS_SH_TAB_SIZE, |
149 | GFP_ATOMIC); | 149 | GFP_ATOMIC); |
150 | if (tbl == NULL) { | 150 | if (tbl == NULL) |
151 | pr_err("%s(): no memory\n", __func__); | ||
152 | return -ENOMEM; | 151 | return -ENOMEM; |
153 | } | 152 | |
154 | svc->sched_data = tbl; | 153 | svc->sched_data = tbl; |
155 | IP_VS_DBG(6, "SH hash table (memory=%Zdbytes) allocated for " | 154 | IP_VS_DBG(6, "SH hash table (memory=%Zdbytes) allocated for " |
156 | "current service\n", | 155 | "current service\n", |
diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c index 1ef41f50723c..fd0d4e09876a 100644 --- a/net/netfilter/ipvs/ip_vs_wrr.c +++ b/net/netfilter/ipvs/ip_vs_wrr.c | |||
@@ -85,10 +85,9 @@ static int ip_vs_wrr_init_svc(struct ip_vs_service *svc) | |||
85 | * Allocate the mark variable for WRR scheduling | 85 | * Allocate the mark variable for WRR scheduling |
86 | */ | 86 | */ |
87 | mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_ATOMIC); | 87 | mark = kmalloc(sizeof(struct ip_vs_wrr_mark), GFP_ATOMIC); |
88 | if (mark == NULL) { | 88 | if (mark == NULL) |
89 | pr_err("%s(): no memory\n", __func__); | ||
90 | return -ENOMEM; | 89 | return -ENOMEM; |
91 | } | 90 | |
92 | mark->cl = &svc->destinations; | 91 | mark->cl = &svc->destinations; |
93 | mark->cw = 0; | 92 | mark->cw = 0; |
94 | mark->mw = ip_vs_wrr_max_weight(svc); | 93 | mark->mw = ip_vs_wrr_max_weight(svc); |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 5acfaf59a9c3..7202b0631cd6 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -661,7 +661,6 @@ __nf_conntrack_alloc(struct net *net, u16 zone, | |||
661 | */ | 661 | */ |
662 | ct = kmem_cache_alloc(net->ct.nf_conntrack_cachep, gfp); | 662 | ct = kmem_cache_alloc(net->ct.nf_conntrack_cachep, gfp); |
663 | if (ct == NULL) { | 663 | if (ct == NULL) { |
664 | pr_debug("nf_conntrack_alloc: Can't alloc conntrack.\n"); | ||
665 | atomic_dec(&net->ct.count); | 664 | atomic_dec(&net->ct.count); |
666 | return ERR_PTR(-ENOMEM); | 665 | return ERR_PTR(-ENOMEM); |
667 | } | 666 | } |
@@ -749,10 +748,8 @@ init_conntrack(struct net *net, struct nf_conn *tmpl, | |||
749 | 748 | ||
750 | ct = __nf_conntrack_alloc(net, zone, tuple, &repl_tuple, GFP_ATOMIC, | 749 | ct = __nf_conntrack_alloc(net, zone, tuple, &repl_tuple, GFP_ATOMIC, |
751 | hash); | 750 | hash); |
752 | if (IS_ERR(ct)) { | 751 | if (IS_ERR(ct)) |
753 | pr_debug("Can't allocate conntrack.\n"); | ||
754 | return (struct nf_conntrack_tuple_hash *)ct; | 752 | return (struct nf_conntrack_tuple_hash *)ct; |
755 | } | ||
756 | 753 | ||
757 | if (!l4proto->new(ct, skb, dataoff)) { | 754 | if (!l4proto->new(ct, skb, dataoff)) { |
758 | nf_conntrack_free(ct); | 755 | nf_conntrack_free(ct); |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index 2d8158acf6fa..66b2c54c544f 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -307,17 +307,14 @@ nfulnl_alloc_skb(unsigned int inst_size, unsigned int pkt_size) | |||
307 | n = max(inst_size, pkt_size); | 307 | n = max(inst_size, pkt_size); |
308 | skb = alloc_skb(n, GFP_ATOMIC); | 308 | skb = alloc_skb(n, GFP_ATOMIC); |
309 | if (!skb) { | 309 | if (!skb) { |
310 | pr_notice("nfnetlink_log: can't alloc whole buffer (%u bytes)\n", | ||
311 | inst_size); | ||
312 | |||
313 | if (n > pkt_size) { | 310 | if (n > pkt_size) { |
314 | /* try to allocate only as much as we need for current | 311 | /* try to allocate only as much as we need for current |
315 | * packet */ | 312 | * packet */ |
316 | 313 | ||
317 | skb = alloc_skb(pkt_size, GFP_ATOMIC); | 314 | skb = alloc_skb(pkt_size, GFP_ATOMIC); |
318 | if (!skb) | 315 | if (!skb) |
319 | pr_err("nfnetlink_log: can't even alloc %u " | 316 | pr_err("nfnetlink_log: can't even alloc %u bytes\n", |
320 | "bytes\n", pkt_size); | 317 | pkt_size); |
321 | } | 318 | } |
322 | } | 319 | } |
323 | 320 | ||
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c index 3bdd443aaf15..f407ebc13481 100644 --- a/net/netfilter/xt_IDLETIMER.c +++ b/net/netfilter/xt_IDLETIMER.c | |||
@@ -122,14 +122,12 @@ static int idletimer_tg_create(struct idletimer_tg_info *info) | |||
122 | 122 | ||
123 | info->timer = kmalloc(sizeof(*info->timer), GFP_KERNEL); | 123 | info->timer = kmalloc(sizeof(*info->timer), GFP_KERNEL); |
124 | if (!info->timer) { | 124 | if (!info->timer) { |
125 | pr_debug("couldn't alloc timer\n"); | ||
126 | ret = -ENOMEM; | 125 | ret = -ENOMEM; |
127 | goto out; | 126 | goto out; |
128 | } | 127 | } |
129 | 128 | ||
130 | info->timer->attr.attr.name = kstrdup(info->label, GFP_KERNEL); | 129 | info->timer->attr.attr.name = kstrdup(info->label, GFP_KERNEL); |
131 | if (!info->timer->attr.attr.name) { | 130 | if (!info->timer->attr.attr.name) { |
132 | pr_debug("couldn't alloc attribute name\n"); | ||
133 | ret = -ENOMEM; | 131 | ret = -ENOMEM; |
134 | goto out_free_timer; | 132 | goto out_free_timer; |
135 | } | 133 | } |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 9228ee0dc11a..dfd52bad1523 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -176,10 +176,7 @@ dsthash_alloc_init(struct xt_hashlimit_htable *ht, | |||
176 | ent = NULL; | 176 | ent = NULL; |
177 | } else | 177 | } else |
178 | ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC); | 178 | ent = kmem_cache_alloc(hashlimit_cachep, GFP_ATOMIC); |
179 | if (!ent) { | 179 | if (ent) { |
180 | if (net_ratelimit()) | ||
181 | pr_err("cannot allocate dsthash_ent\n"); | ||
182 | } else { | ||
183 | memcpy(&ent->dst, dst, sizeof(ent->dst)); | 180 | memcpy(&ent->dst, dst, sizeof(ent->dst)); |
184 | spin_lock_init(&ent->lock); | 181 | spin_lock_init(&ent->lock); |
185 | 182 | ||