aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2008-09-12 20:57:23 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-12 20:57:23 -0400
commitf07d1501292b3b0d3276ee0e537005526a45e242 (patch)
treedf132456469046ec7f71ea4ac39723450c8e3c6e /net/sched
parent67333bb5679325db310bb612c1de3e6e47bb0043 (diff)
multiq: Further multiqueue cleanup
This patch resolves a few issues found with multiq including wording suggestions and a problem seen in the allocation of queues. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_multiq.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/sched/sch_multiq.c b/net/sched/sch_multiq.c
index 49a8b67ed3b..5d9cd68e91d 100644
--- a/net/sched/sch_multiq.c
+++ b/net/sched/sch_multiq.c
@@ -214,8 +214,8 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)
214 sch_tree_lock(sch); 214 sch_tree_lock(sch);
215 q->bands = qopt->bands; 215 q->bands = qopt->bands;
216 for (i = q->bands; i < q->max_bands; i++) { 216 for (i = q->bands; i < q->max_bands; i++) {
217 struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc); 217 if (q->queues[i] != &noop_qdisc) {
218 if (child != &noop_qdisc) { 218 struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc);
219 qdisc_tree_decrease_qlen(child, child->q.qlen); 219 qdisc_tree_decrease_qlen(child, child->q.qlen);
220 qdisc_destroy(child); 220 qdisc_destroy(child);
221 } 221 }
@@ -250,7 +250,7 @@ static int multiq_tune(struct Qdisc *sch, struct nlattr *opt)
250static int multiq_init(struct Qdisc *sch, struct nlattr *opt) 250static int multiq_init(struct Qdisc *sch, struct nlattr *opt)
251{ 251{
252 struct multiq_sched_data *q = qdisc_priv(sch); 252 struct multiq_sched_data *q = qdisc_priv(sch);
253 int i; 253 int i, err;
254 254
255 q->queues = NULL; 255 q->queues = NULL;
256 256
@@ -265,7 +265,12 @@ static int multiq_init(struct Qdisc *sch, struct nlattr *opt)
265 for (i = 0; i < q->max_bands; i++) 265 for (i = 0; i < q->max_bands; i++)
266 q->queues[i] = &noop_qdisc; 266 q->queues[i] = &noop_qdisc;
267 267
268 return multiq_tune(sch, opt); 268 err = multiq_tune(sch,opt);
269
270 if (err)
271 kfree(q->queues);
272
273 return err;
269} 274}
270 275
271static int multiq_dump(struct Qdisc *sch, struct sk_buff *skb) 276static int multiq_dump(struct Qdisc *sch, struct sk_buff *skb)