diff options
Diffstat (limited to 'net/sched/sch_htb.c')
-rw-r--r-- | net/sched/sch_htb.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 34afe41fa2f3..880a3394a51f 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -196,7 +196,7 @@ struct htb_class | |||
196 | struct qdisc_rate_table *rate; /* rate table of the class itself */ | 196 | struct qdisc_rate_table *rate; /* rate table of the class itself */ |
197 | struct qdisc_rate_table *ceil; /* ceiling rate (limits borrows too) */ | 197 | struct qdisc_rate_table *ceil; /* ceiling rate (limits borrows too) */ |
198 | long buffer,cbuffer; /* token bucket depth/rate */ | 198 | long buffer,cbuffer; /* token bucket depth/rate */ |
199 | long mbuffer; /* max wait time */ | 199 | psched_tdiff_t mbuffer; /* max wait time */ |
200 | long tokens,ctokens; /* current number of tokens */ | 200 | long tokens,ctokens; /* current number of tokens */ |
201 | psched_time_t t_c; /* checkpoint time */ | 201 | psched_time_t t_c; /* checkpoint time */ |
202 | }; | 202 | }; |
@@ -1559,10 +1559,9 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1559 | goto failure; | 1559 | goto failure; |
1560 | } | 1560 | } |
1561 | err = -ENOBUFS; | 1561 | err = -ENOBUFS; |
1562 | if ((cl = kmalloc(sizeof(*cl), GFP_KERNEL)) == NULL) | 1562 | if ((cl = kzalloc(sizeof(*cl), GFP_KERNEL)) == NULL) |
1563 | goto failure; | 1563 | goto failure; |
1564 | 1564 | ||
1565 | memset(cl, 0, sizeof(*cl)); | ||
1566 | cl->refcnt = 1; | 1565 | cl->refcnt = 1; |
1567 | INIT_LIST_HEAD(&cl->sibling); | 1566 | INIT_LIST_HEAD(&cl->sibling); |
1568 | INIT_LIST_HEAD(&cl->hlist); | 1567 | INIT_LIST_HEAD(&cl->hlist); |
@@ -1601,7 +1600,7 @@ static int htb_change_class(struct Qdisc *sch, u32 classid, | |||
1601 | /* set class to be in HTB_CAN_SEND state */ | 1600 | /* set class to be in HTB_CAN_SEND state */ |
1602 | cl->tokens = hopt->buffer; | 1601 | cl->tokens = hopt->buffer; |
1603 | cl->ctokens = hopt->cbuffer; | 1602 | cl->ctokens = hopt->cbuffer; |
1604 | cl->mbuffer = 60000000; /* 1min */ | 1603 | cl->mbuffer = PSCHED_JIFFIE2US(HZ*60); /* 1min */ |
1605 | PSCHED_GET_TIME(cl->t_c); | 1604 | PSCHED_GET_TIME(cl->t_c); |
1606 | cl->cmode = HTB_CAN_SEND; | 1605 | cl->cmode = HTB_CAN_SEND; |
1607 | 1606 | ||