diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2011-02-14 22:02:23 +0300 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2011-02-14 22:07:58 +0300 |
commit | ac7100ba93428a26cde8e47dfcfcfbfbfcce66de (patch) | |
tree | 1750fd2e7dc4b48748fe59d7737f460185ad5990 | |
parent | 263fb5b1bf9265d0e4ce59ff6ea92f478b5b61ea (diff) | |
download | linux-ac7100ba93428a26cde8e47dfcfcfbfbfcce66de.tar.xz |
sch_mqprio: Always set num_tc to 0 in mqprio_destroy()
All the cleanup code in mqprio_destroy() is currently conditional on
priv->qdiscs being non-null, but that condition should only apply to
the per-queue qdisc cleanup. We should always set the number of
traffic classes back to 0 here.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
-rw-r--r-- | net/sched/sch_mqprio.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sched/sch_mqprio.c b/net/sched/sch_mqprio.c index effd4ee0e880..ace37f9f1cd0 100644 --- a/net/sched/sch_mqprio.c +++ b/net/sched/sch_mqprio.c @@ -29,18 +29,18 @@ static void mqprio_destroy(struct Qdisc *sch) struct mqprio_sched *priv = qdisc_priv(sch); unsigned int ntx; - if (!priv->qdiscs) - return; - - for (ntx = 0; ntx < dev->num_tx_queues && priv->qdiscs[ntx]; ntx++) - qdisc_destroy(priv->qdiscs[ntx]); + if (priv->qdiscs) { + for (ntx = 0; + ntx < dev->num_tx_queues && priv->qdiscs[ntx]; + ntx++) + qdisc_destroy(priv->qdiscs[ntx]); + kfree(priv->qdiscs); + } if (priv->hw_owned && dev->netdev_ops->ndo_setup_tc) dev->netdev_ops->ndo_setup_tc(dev, 0); else netdev_set_num_tc(dev, 0); - - kfree(priv->qdiscs); } static int mqprio_parse_opt(struct net_device *dev, struct tc_mqprio_qopt *qopt) |