aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/act_api.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/act_api.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/act_api.c')
-rw-r--r--net/sched/act_api.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 9affeeedf107..a2587b52e531 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -312,10 +312,9 @@ struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est,
312 } 312 }
313 313
314 *err = -ENOMEM; 314 *err = -ENOMEM;
315 a = kmalloc(sizeof(*a), GFP_KERNEL); 315 a = kzalloc(sizeof(*a), GFP_KERNEL);
316 if (a == NULL) 316 if (a == NULL)
317 goto err_mod; 317 goto err_mod;
318 memset(a, 0, sizeof(*a));
319 318
320 /* backward compatibility for policer */ 319 /* backward compatibility for policer */
321 if (name == NULL) 320 if (name == NULL)
@@ -492,10 +491,9 @@ tcf_action_get_1(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int *err)
492 index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]); 491 index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]);
493 492
494 *err = -ENOMEM; 493 *err = -ENOMEM;
495 a = kmalloc(sizeof(struct tc_action), GFP_KERNEL); 494 a = kzalloc(sizeof(struct tc_action), GFP_KERNEL);
496 if (a == NULL) 495 if (a == NULL)
497 return NULL; 496 return NULL;
498 memset(a, 0, sizeof(struct tc_action));
499 497
500 *err = -EINVAL; 498 *err = -EINVAL;
501 a->ops = tc_lookup_action(tb[TCA_ACT_KIND - 1]); 499 a->ops = tc_lookup_action(tb[TCA_ACT_KIND - 1]);
@@ -531,12 +529,11 @@ static struct tc_action *create_a(int i)
531{ 529{
532 struct tc_action *act; 530 struct tc_action *act;
533 531
534 act = kmalloc(sizeof(*act), GFP_KERNEL); 532 act = kzalloc(sizeof(*act), GFP_KERNEL);
535 if (act == NULL) { 533 if (act == NULL) {
536 printk("create_a: failed to alloc!\n"); 534 printk("create_a: failed to alloc!\n");
537 return NULL; 535 return NULL;
538 } 536 }
539 memset(act, 0, sizeof(*act));
540 act->order = i; 537 act->order = i;
541 return act; 538 return act;
542} 539}