提交 ae81feb7 编写于 作者: Y Yunjian Wang 提交者: David S. Miller

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: d03b195b ("sch_htb: Hierarchical QoS hardware offload")
Signed-off-by: NYunjian Wang <wangyunjian@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 8a03dd92
......@@ -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);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册