summaryrefslogtreecommitdiffstats
path: root/net/sched/act_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/act_api.c')
-rw-r--r--net/sched/act_api.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index 599423c..a2587b5 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,
}
*err = -ENOMEM;
- a = kmalloc(sizeof(*a), GFP_KERNEL);
+ a = kzalloc(sizeof(*a), GFP_KERNEL);
if (a == NULL)
goto err_mod;
- memset(a, 0, sizeof(*a));
/* backward compatibility for policer */
if (name == NULL)
@@ -492,10 +491,9 @@ tcf_action_get_1(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int *err)
index = *(int *)RTA_DATA(tb[TCA_ACT_INDEX - 1]);
*err = -ENOMEM;
- a = kmalloc(sizeof(struct tc_action), GFP_KERNEL);
+ a = kzalloc(sizeof(struct tc_action), GFP_KERNEL);
if (a == NULL)
return NULL;
- memset(a, 0, sizeof(struct tc_action));
*err = -EINVAL;
a->ops = tc_lookup_action(tb[TCA_ACT_KIND - 1]);
@@ -531,12 +529,11 @@ static struct tc_action *create_a(int i)
{
struct tc_action *act;
- act = kmalloc(sizeof(*act), GFP_KERNEL);
+ act = kzalloc(sizeof(*act), GFP_KERNEL);
if (act == NULL) {
printk("create_a: failed to alloc!\n");
return NULL;
}
- memset(act, 0, sizeof(*act));
act->order = i;
return act;
}
@@ -602,8 +599,8 @@ static int tca_action_flush(struct rtattr *rta, struct nlmsghdr *n, u32 pid)
return err;
rtattr_failure:
- module_put(a->ops->owner);
nlmsg_failure:
+ module_put(a->ops->owner);
err_out:
kfree_skb(skb);
kfree(a);
@@ -884,8 +881,6 @@ static int __init tc_action_init(void)
link_p[RTM_GETACTION-RTM_BASE].dumpit = tc_dump_action;
}
- printk("TC classifier action (bugs to netdev@vger.kernel.org cc "
- "hadi@cyberus.ca)\n");
return 0;
}
OpenPOWER on IntegriCloud