diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 19c390ab2b7c936e144fb3af0163fc2f89f552ff..c927d511bb650919b1afd47919d1eb5088d01093 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -1031,8 +1031,12 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, unsigned long cl = cops->find(parent, classid); if (cl) { - err = cops->graft(parent, cl, new, &old, - extack); + if (new && new->ops == &noqueue_qdisc_ops) { + NL_SET_ERR_MSG(extack, "Cannot assign noqueue to a class"); + err = -EINVAL; + } else { + err = cops->graft(parent, cl, new, &old, extack); + } } else { NL_SET_ERR_MSG(extack, "Specified class not found"); err = -ENOENT;