From: Ido Schimmel <idosch@idosch.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org
Subject: Re: [PATCH net-next] net: ethtool: fix leaking netdev ref if ethnl_default_parse() failed
Date: Tue, 1 Jul 2025 13:44:58 +0300 [thread overview]
Message-ID: <aGO8KoNoWs2MJpDe@shredder> (raw)
In-Reply-To: <20250630154053.1074664-1-kuba@kernel.org>
On Mon, Jun 30, 2025 at 08:40:53AM -0700, Jakub Kicinski wrote:
> Ido spotted that I made a mistake in commit under Fixes,
> ethnl_default_parse() may acquire a dev reference even when it returns
> an error. This may have been driven by the code structure in dumps
> (which unconditionally release dev before handling errors), but it's
> too much of a trap. Functions should undo what they did before returning
> an error, rather than expecting caller to clean up.
>
> Rather than fixing ethnl_default_set_doit() directly make
> ethnl_default_parse() clean up errors.
>
> Reported-by: Ido Schimmel <idosch@idosch.org>
> Link: https://lore.kernel.org/aGEPszpq9eojNF4Y@shredder
> Fixes: 963781bdfe20 ("net: ethtool: call .parse_request for SET handlers")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Thanks!
next prev parent reply other threads:[~2025-07-01 10:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 15:40 [PATCH net-next] net: ethtool: fix leaking netdev ref if ethnl_default_parse() failed Jakub Kicinski
2025-07-01 10:44 ` Ido Schimmel [this message]
2025-07-02 0:50 ` patchwork-bot+netdevbpf
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=aGO8KoNoWs2MJpDe@shredder \
--to=idosch@idosch.org \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).