All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: chia-yu.chang@nokia-bell-labs.com
Cc: alok.a.tiwari@oracle.com, pctammela@mojatatu.com,
	horms@kernel.org, donald.hunter@gmail.com, xandfury@gmail.com,
	netdev@vger.kernel.org, dave.taht@gmail.com, pabeni@redhat.com,
	jhs@mojatatu.com, stephen@networkplumber.org,
	xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net,
	edumazet@google.com, andrew+netdev@lunn.ch, ast@fiberby.net,
	liuhangbin@gmail.com, shuah@kernel.org,
	linux-kselftest@vger.kernel.org, ij@kernel.org,
	ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com,
	g.white@cablelabs.com, ingemar.s.johansson@ericsson.com,
	mirja.kuehlewind@ericsson.com, cheshire@apple.com,
	rs.ietf@gmx.at, Jason_Livingood@comcast.com,
	vidhi_goel@apple.com
Subject: Re: [PATCH v25 net-next 1/6] sched: Struct definition and parsing of dualpi2 qdisc
Date: Mon, 21 Jul 2025 17:52:43 -0700	[thread overview]
Message-ID: <20250721175243.5e620997@kernel.org> (raw)
In-Reply-To: <20250719204129.15737-2-chia-yu.chang@nokia-bell-labs.com>

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.
-- 
pw-bot: cr

  reply	other threads:[~2025-07-22  0:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-19 20:41 [PATCH v25 net-next 0/6] DUALPI2 patch chia-yu.chang
2025-07-19 20:41 ` [PATCH v25 net-next 1/6] sched: Struct definition and parsing of dualpi2 qdisc chia-yu.chang
2025-07-22  0:52   ` Jakub Kicinski [this message]
2025-07-22 10:04     ` Chia-Yu Chang (Nokia)
2025-07-19 20:41 ` [PATCH v25 net-next 2/6] sched: Dump configuration and statistics " chia-yu.chang
2025-07-19 20:41 ` [PATCH v25 net-next 3/6] sched: Add enqueue/dequeue " chia-yu.chang
2025-07-19 20:41 ` [PATCH v25 net-next 4/6] selftests/tc-testing: Fix warning and style check on tdc.sh chia-yu.chang
2025-07-19 20:41 ` [PATCH v25 net-next 5/6] selftests/tc-testing: Add selftests for qdisc DualPI2 chia-yu.chang
2025-07-19 20:41 ` [PATCH v25 net-next 6/6] Documentation: netlink: specs: tc: Add DualPI2 specification chia-yu.chang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250721175243.5e620997@kernel.org \
    --to=kuba@kernel.org \
    --cc=Jason_Livingood@comcast.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@fiberby.net \
    --cc=cheshire@apple.com \
    --cc=chia-yu.chang@nokia-bell-labs.com \
    --cc=dave.taht@gmail.com \
    --cc=davem@davemloft.net \
    --cc=donald.hunter@gmail.com \
    --cc=edumazet@google.com \
    --cc=g.white@cablelabs.com \
    --cc=horms@kernel.org \
    --cc=ij@kernel.org \
    --cc=ingemar.s.johansson@ericsson.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=koen.de_schepper@nokia-bell-labs.com \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=liuhangbin@gmail.com \
    --cc=mirja.kuehlewind@ericsson.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pctammela@mojatatu.com \
    --cc=rs.ietf@gmx.at \
    --cc=shuah@kernel.org \
    --cc=stephen@networkplumber.org \
    --cc=vidhi_goel@apple.com \
    --cc=xandfury@gmail.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.