Netdev List
 help / color / mirror / Atom feed
From: Jeremy Kerr <jk@codeconstruct.com.au>
To: Aldo Ariel Panzardo <qwe.aldo@gmail.com>,
	Matt Johnston <matt@codeconstruct.com.au>,
	Yiqi Sun <sunyiqixm@gmail.com>
Cc: davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: mctp: hold a reference to the route device in mctp_route_lookup()
Date: Thu, 13 Aug 2026 21:19:44 -0500	[thread overview]
Message-ID: <55cd94e61d68d95e9db16f21980a532f4edf70e1.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20260813022102.2792032-1-qwe.aldo@gmail.com>

Hi Aldo,

> mctp_route_lookup() uses rt->dev without holding a reference on it.

[...]

> Take a reference with refcount_inc_not_zero() before touching rt->dev,
> skip a device that is already dead, and drop the reference once the
> destination has taken its own.

This looks the same as Yiqi Sun's analysis:

  https://lore.kernel.org/netdev/20260731022926.913865-1-sunyiqixm@gmail.com/

I had requested some simplifications for the proposed fix, which would
likely result in something very close to your contribution here.

Yiqi had not followed up from that review as yet, though; so if we don't
see any updated patch shortly, then your implementation looks reasonable.

Regards,


Jeremy

      reply	other threads:[~2026-08-14  2:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13  2:21 [PATCH] net: mctp: hold a reference to the route device in mctp_route_lookup() Aldo Ariel Panzardo
2026-08-14  2:19 ` Jeremy Kerr [this message]

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=55cd94e61d68d95e9db16f21980a532f4edf70e1.camel@codeconstruct.com.au \
    --to=jk@codeconstruct.com.au \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeconstruct.com.au \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qwe.aldo@gmail.com \
    --cc=sunyiqixm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox