aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_route.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/cls_route.c')
-rw-r--r--net/sched/cls_route.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index 520ff716dab2..d3aea730d4c8 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/config.h>
14#include <asm/uaccess.h> 13#include <asm/uaccess.h>
15#include <asm/system.h> 14#include <asm/system.h>
16#include <linux/bitops.h> 15#include <linux/bitops.h>
@@ -397,10 +396,9 @@ static int route4_set_parms(struct tcf_proto *tp, unsigned long base,
397 h1 = to_hash(nhandle); 396 h1 = to_hash(nhandle);
398 if ((b = head->table[h1]) == NULL) { 397 if ((b = head->table[h1]) == NULL) {
399 err = -ENOBUFS; 398 err = -ENOBUFS;
400 b = kmalloc(sizeof(struct route4_bucket), GFP_KERNEL); 399 b = kzalloc(sizeof(struct route4_bucket), GFP_KERNEL);
401 if (b == NULL) 400 if (b == NULL)
402 goto errout; 401 goto errout;
403 memset(b, 0, sizeof(*b));
404 402
405 tcf_tree_lock(tp); 403 tcf_tree_lock(tp);
406 head->table[h1] = b; 404 head->table[h1] = b;
@@ -476,20 +474,18 @@ static int route4_change(struct tcf_proto *tp, unsigned long base,
476 474
477 err = -ENOBUFS; 475 err = -ENOBUFS;
478 if (head == NULL) { 476 if (head == NULL) {
479 head = kmalloc(sizeof(struct route4_head), GFP_KERNEL); 477 head = kzalloc(sizeof(struct route4_head), GFP_KERNEL);
480 if (head == NULL) 478 if (head == NULL)
481 goto errout; 479 goto errout;
482 memset(head, 0, sizeof(struct route4_head));
483 480
484 tcf_tree_lock(tp); 481 tcf_tree_lock(tp);
485 tp->root = head; 482 tp->root = head;
486 tcf_tree_unlock(tp); 483 tcf_tree_unlock(tp);
487 } 484 }
488 485
489 f = kmalloc(sizeof(struct route4_filter), GFP_KERNEL); 486 f = kzalloc(sizeof(struct route4_filter), GFP_KERNEL);
490 if (f == NULL) 487 if (f == NULL)
491 goto errout; 488 goto errout;
492 memset(f, 0, sizeof(*f));
493 489
494 err = route4_set_parms(tp, base, f, handle, head, tb, 490 err = route4_set_parms(tp, base, f, handle, head, tb,
495 tca[TCA_RATE-1], 1); 491 tca[TCA_RATE-1], 1);