mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
sch_htb: fix null pointer dereference on a null new_q
sch_htb: fix null pointer dereference on a null new_q
Currently if new_q is null, the null new_q pointer will be
dereference when 'q->offload' is true. Fix this by adding
a braces around htb_parent_to_leaf_offload() to avoid it.
Addresses-Coverity: ("Dereference after null check")
Fixes: d03b195b5a ("sch_htb: Hierarchical QoS hardware offload")
Signed-off-by: Yunjian Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
8a03dd9257
commit
ae81feb733
1 file changed
+3
-2
+3
-2
@@ -1675,9 +1675,10 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg,
|
||||
cl->parent->common.classid,
|
||||
NULL);
|
||||
if (q->offload) {
|
||||
if (new_q)
|
||||
if (new_q) {
|
||||
htb_set_lockdep_class_child(new_q);
|
||||
htb_parent_to_leaf_offload(sch, dev_queue, new_q);
|
||||
htb_parent_to_leaf_offload(sch, dev_queue, new_q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user