diff options
Diffstat (limited to 'net/sched/act_api.c')
| -rw-r--r-- | net/sched/act_api.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 599423cc9d0d..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 | } |
| @@ -602,8 +599,8 @@ static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid) | |||
| 602 | return err; | 599 | return err; |
| 603 | 600 | ||
| 604 | rtattr_failure: | 601 | rtattr_failure: |
| 605 | module_put(a->ops->owner); | ||
| 606 | nlmsg_failure: | 602 | nlmsg_failure: |
| 603 | module_put(a->ops->owner); | ||
| 607 | err_out: | 604 | err_out: |
| 608 | kfree_skb(skb); | 605 | kfree_skb(skb); |
| 609 | kfree(a); | 606 | kfree(a); |
| @@ -884,8 +881,6 @@ static int __init tc_action_init(void) | |||
| 884 | link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action; | 881 | link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action; |
| 885 | } | 882 | } |
| 886 | 883 | ||
| 887 | printk("TC classifier action (bugs to netdev@vger.kernel.org cc " | ||
| 888 | "hadi@cyberus.ca)\n"); | ||
| 889 | return 0; | 884 | return 0; |
| 890 | } | 885 | } |
| 891 | 886 | ||
