On Sat, 19 Jul 2025 22:41:24 +0200 chia-yu.chang@nokia-bell-labs.com wrote:
- q = qdisc_priv(sch);
- sch_tree_lock(sch);
- if (tb[TCA_DUALPI2_STEP_THRESH_PKTS] && tb[TCA_DUALPI2_STEP_THRESH_US]) {
NL_SET_ERR_MSG_MOD(extack, "multiple step thresh attributes");
sch_tree_unlock(sch);
return -EINVAL;
- }
tb[] is local state on the stack, parsed from the netlink message (also local). You can move the:
q = qdisc_priv(sch); sch_tree_lock(sch);
lines after the check and then you won't have to unlock on the error path.