diff options
author | Panagiotis Issaris <takis@issaris.org> | 2006-07-21 17:51:30 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:51:30 -0400 |
commit | 0da974f4f303a6842516b764507e3c0a03f41e5a (patch) | |
tree | 8872aec792f02040269c6769dd1009b20f71d186 /net/sched/act_police.c | |
parent | a0ee7c70b22f78593957f99faa06acb4747b8bc0 (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_police.c')
-rw-r--r-- | net/sched/act_police.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 47e00bd9625..da905d7b4b4 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
@@ -196,10 +196,9 @@ static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est, | |||
196 | return ret; | 196 | return ret; |
197 | } | 197 | } |
198 | 198 | ||
199 | p = kmalloc(sizeof(*p), GFP_KERNEL); | 199 | p = kzalloc(sizeof(*p), GFP_KERNEL); |
200 | if (p == NULL) | 200 | if (p == NULL) |
201 | return -ENOMEM; | 201 | return -ENOMEM; |
202 | memset(p, 0, sizeof(*p)); | ||
203 | 202 | ||
204 | ret = ACT_P_CREATED; | 203 | ret = ACT_P_CREATED; |
205 | p->refcnt = 1; | 204 | p->refcnt = 1; |
@@ -429,11 +428,10 @@ struct tcf_police * tcf_police_locate(struct rtattr *rta, struct rtattr *est) | |||
429 | return p; | 428 | return p; |
430 | } | 429 | } |
431 | 430 | ||
432 | p = kmalloc(sizeof(*p), GFP_KERNEL); | 431 | p = kzalloc(sizeof(*p), GFP_KERNEL); |
433 | if (p == NULL) | 432 | if (p == NULL) |
434 | return NULL; | 433 | return NULL; |
435 | 434 | ||
436 | memset(p, 0, sizeof(*p)); | ||
437 | p->refcnt = 1; | 435 | p->refcnt = 1; |
438 | spin_lock_init(&p->lock); | 436 | spin_lock_init(&p->lock); |
439 | p->stats_lock = &p->lock; | 437 | p->stats_lock = &p->lock; |