Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d3f0cd4 authored by Gao Feng's avatar Gao Feng Committed by David S. Miller
Browse files

net: sched: Add the invalid handle check in qdisc_class_find



Add the invalid handle "0" check to avoid unnecessary search, because
the qdisc uses the skb->priority as the handle value to look up, and
it is "0" usually.

Signed-off-by: default avatarGao Feng <gfree.wind@vip.163.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40501f90
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -393,6 +393,9 @@ qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
	struct Qdisc_class_common *cl;
	struct Qdisc_class_common *cl;
	unsigned int h;
	unsigned int h;


	if (!id)
		return NULL;

	h = qdisc_class_hash(id, hash->hashmask);
	h = qdisc_class_hash(id, hash->hashmask);
	hlist_for_each_entry(cl, &hash->hash[h], hnode) {
	hlist_for_each_entry(cl, &hash->hash[h], hnode) {
		if (cl->classid == id)
		if (cl->classid == id)