From 17a2b64d7dc6d06d62a4381d622c492f44663381 Mon Sep 17 00:00:00 2001 From: Ivan Vecera Date: Thu, 27 Apr 2023 13:19:27 +0200 Subject: [PATCH] net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune() Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2172886 commit 4b7477f0921a2dc9594b6bb0c893e79169c6e829 Author: Zhengchao Shao Date: Fri Aug 26 12:10:35 2022 +0800 net: sched: using TCQ_MIN_PRIO_BANDS in prio_tune() Using TCQ_MIN_PRIO_BANDS instead of magic number in prio_tune(). Signed-off-by: Zhengchao Shao Acked-by: Cong Wang Link: https://lore.kernel.org/r/20220826041035.80129-1-shaozhengchao@huawei.com Signed-off-by: Paolo Abeni Signed-off-by: Ivan Vecera --- net/sched/sch_prio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index c03a11dd990f..298794c04836 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c @@ -185,7 +185,7 @@ static int prio_tune(struct Qdisc *sch, struct nlattr *opt, return -EINVAL; qopt = nla_data(opt); - if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < 2) + if (qopt->bands > TCQ_PRIO_BANDS || qopt->bands < TCQ_MIN_PRIO_BANDS) return -EINVAL; for (i = 0; i <= TC_PRIO_MAX; i++) {