summaryrefslogtreecommitdiffstats
path: root/net/sched/sch_htb.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2023-02-06 09:25:56 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2023-02-06 09:25:56 -0300
commitab809efaeba0cca20cfcda23852b0ee958f6ea69 (patch)
tree36b168deb9908cba8605bb8fa026bdacc26560db /net/sched/sch_htb.c
parent17f248aa8664ff5b3643491136283e73b5c18166 (diff)
parentd2d11f342b179f1894a901f143ec7c008caba43e (diff)
downloadlinux-stable-ab809efaeba0cca20cfcda23852b0ee958f6ea69.tar.gz
linux-stable-ab809efaeba0cca20cfcda23852b0ee958f6ea69.tar.bz2
linux-stable-ab809efaeba0cca20cfcda23852b0ee958f6ea69.zip
Merge remote-tracking branch 'torvalds/master' into perf/core
To sync with libbpf, etc. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'net/sched/sch_htb.c')
-rw-r--r--net/sched/sch_htb.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index f46643850df8..cc28e41fb745 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -431,7 +431,10 @@ static void htb_activate_prios(struct htb_sched *q, struct htb_class *cl)
while (cl->cmode == HTB_MAY_BORROW && p && mask) {
m = mask;
while (m) {
- int prio = ffz(~m);
+ unsigned int prio = ffz(~m);
+
+ if (WARN_ON_ONCE(prio > ARRAY_SIZE(p->inner.clprio)))
+ break;
m &= ~(1 << prio);
if (p->inner.clprio[prio].feed.rb_node)