aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/cls_route.c
diff options
context:
space:
mode:
authorPanagiotis Issaris <takis@issaris.org>2006-07-21 17:51:30 -0400
committerDavid S. Miller <davem@davemloft.net>2006-07-21 17:51:30 -0400
commit0da974f4f303a6842516b764507e3c0a03f41e5a (patch)
tree8872aec792f02040269c6769dd1009b20f71d186 /net/sched/cls_route.c
parenta0ee7c70b22f78593957f99faa06acb4747b8bc0 (diff)
[NET]: Conversions from kmalloc+memset to k(z|c)alloc.
Signed-off-by: Panagiotis Issaris <takis@issaris.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_route.c')
-rw-r--r--net/sched/cls_route.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c
index c2e71900f7bd..d3aea730d4c8 100644
--- a/net/sched/cls_route.c
+++ b/net/sched/cls_route.c
@@ -396,10 +396,9 @@ static int route4_set_parms(struct tcf_proto *tp, unsigned long base,
396 h1 = to_hash(nhandle); 396 h1 = to_hash(nhandle);
397 if ((b = head->table[h1]) == NULL) { 397 if ((b = head->table[h1]) == NULL) {
398 err = -ENOBUFS; 398 err = -ENOBUFS;
399 b = kmalloc(sizeof(struct route4_bucket), GFP_KERNEL); 399 b = kzalloc(sizeof(struct route4_bucket), GFP_KERNEL);
400 if (b == NULL) 400 if (b == NULL)
401 goto errout; 401 goto errout;
402 memset(b, 0, sizeof(*b));
403 402
404 tcf_tree_lock(tp); 403 tcf_tree_lock(tp);
405 head->table[h1] = b; 404 head->table[h1] = b;
@@ -475,20 +474,18 @@ static int route4_change(struct tcf_proto *tp, unsigned long base,
475 474
476 err = -ENOBUFS; 475 err = -ENOBUFS;
477 if (head == NULL) { 476 if (head == NULL) {
478 head = kmalloc(sizeof(struct route4_head), GFP_KERNEL); 477 head = kzalloc(sizeof(struct route4_head), GFP_KERNEL);
479 if (head == NULL) 478 if (head == NULL)
480 goto errout; 479 goto errout;
481 memset(head, 0, sizeof(struct route4_head));
482 480
483 tcf_tree_lock(tp); 481 tcf_tree_lock(tp);
484 tp->root = head; 482 tp->root = head;
485 tcf_tree_unlock(tp); 483 tcf_tree_unlock(tp);
486 } 484 }
487 485
488 f = kmalloc(sizeof(struct route4_filter), GFP_KERNEL); 486 f = kzalloc(sizeof(struct route4_filter), GFP_KERNEL);
489 if (f == NULL) 487 if (f == NULL)
490 goto errout; 488 goto errout;
491 memset(f, 0, sizeof(*f));
492 489
493 err = route4_set_parms(tp, base, f, handle, head, tb, 490 err = route4_set_parms(tp, base, f, handle, head, tb,
494 tca[TCA_RATE-1], 1); 491 tca[TCA_RATE-1], 1);