diff options
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 47e00bd9625e..da905d7b4b40 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; |