|
|
@@ -118,10 +118,8 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)
|
|
|
/* pre-allocate qdisc, attachment can't fail */
|
|
|
priv->qdiscs = kcalloc(dev->num_tx_queues, sizeof(priv->qdiscs[0]),
|
|
|
GFP_KERNEL);
|
|
|
- if (priv->qdiscs == NULL) {
|
|
|
- err = -ENOMEM;
|
|
|
- goto err;
|
|
|
- }
|
|
|
+ if (!priv->qdiscs)
|
|
|
+ return -ENOMEM;
|
|
|
|
|
|
for (i = 0; i < dev->num_tx_queues; i++) {
|
|
|
dev_queue = netdev_get_tx_queue(dev, i);
|
|
|
@@ -129,10 +127,9 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)
|
|
|
get_default_qdisc_ops(dev, i),
|
|
|
TC_H_MAKE(TC_H_MAJ(sch->handle),
|
|
|
TC_H_MIN(i + 1)));
|
|
|
- if (qdisc == NULL) {
|
|
|
- err = -ENOMEM;
|
|
|
- goto err;
|
|
|
- }
|
|
|
+ if (!qdisc)
|
|
|
+ return -ENOMEM;
|
|
|
+
|
|
|
priv->qdiscs[i] = qdisc;
|
|
|
qdisc->flags |= TCQ_F_ONETXQUEUE | TCQ_F_NOPARENT;
|
|
|
}
|
|
|
@@ -148,7 +145,7 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)
|
|
|
priv->hw_owned = 1;
|
|
|
err = dev->netdev_ops->ndo_setup_tc(dev, sch->handle, 0, &tc);
|
|
|
if (err)
|
|
|
- goto err;
|
|
|
+ return err;
|
|
|
} else {
|
|
|
netdev_set_num_tc(dev, qopt->num_tc);
|
|
|
for (i = 0; i < qopt->num_tc; i++)
|
|
|
@@ -162,10 +159,6 @@ static int mqprio_init(struct Qdisc *sch, struct nlattr *opt)
|
|
|
|
|
|
sch->flags |= TCQ_F_MQROOT;
|
|
|
return 0;
|
|
|
-
|
|
|
-err:
|
|
|
- mqprio_destroy(sch);
|
|
|
- return err;
|
|
|
}
|
|
|
|
|
|
static void mqprio_attach(struct Qdisc *sch)
|