Skip to content

Commit 7d3f0cd

Browse files
gfreewinddavem330
authored andcommitted
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: Gao Feng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 40501f9 commit 7d3f0cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/net/sch_generic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
393393
struct Qdisc_class_common *cl;
394394
unsigned int h;
395395

396+
if (!id)
397+
return NULL;
398+
396399
h = qdisc_class_hash(id, hash->hashmask);
397400
hlist_for_each_entry(cl, &hash->hash[h], hnode) {
398401
if (cl->classid == id)

0 commit comments

Comments
 (0)