aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/ipset/ip_set_core.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_core.c5
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c18
-rw-r--r--net/netfilter/ipvs/ip_vs_dh.c5
-rw-r--r--net/netfilter/ipvs/ip_vs_lblc.c9
-rw-r--r--net/netfilter/ipvs/ip_vs_lblcr.c13
-rw-r--r--net/netfilter/ipvs/ip_vs_proto.c5
-rw-r--r--net/netfilter/ipvs/ip_vs_sh.c5
-rw-r--r--net/netfilter/ipvs/ip_vs_wrr.c5
-rw-r--r--net/netfilter/nf_conntrack_core.c5
-rw-r--r--net/netfilter/nfnetlink_log.c7
-rw-r--r--net/netfilter/xt_IDLETIMER.c2
-rw-r--r--net/netfilter/xt_hashlimit.c5
13 files changed, 28 insertions, 60 deletions
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