From: Marcin Wojtas <mw@semihalf.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
netdev <netdev@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
vivien.didelot@gmail.com, Florian Fainelli <f.fainelli@gmail.com>,
upstream@semihalf.com
Subject: Re: [net: PATCH] net: dsa: add missing refcount decrementation
Date: Wed, 27 Apr 2022 19:38:09 +0200 [thread overview]
Message-ID: <CAPv3WKeFudAqSrPbxeFLvs=myo1UDhBo+GPOZ6dGgpwC-eq8eg@mail.gmail.com> (raw)
In-Reply-To: <20220427172514.n4musn42dhygzbu2@skbuf>
śr., 27 kwi 2022 o 19:25 Vladimir Oltean <olteanv@gmail.com> napisał(a):
>
> On Mon, Apr 25, 2022 at 11:47:08AM +0200, Marcin Wojtas wrote:
> > After obtaining the "phy-handle" node, decrementing
> > refcount is required. Fix that.
> >
> > Fixes: a20f997010c4 ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed")
> > Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> > ---
> > net/dsa/port.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/net/dsa/port.c b/net/dsa/port.c
> > index 32d472a82241..cdc56ba11f52 100644
> > --- a/net/dsa/port.c
> > +++ b/net/dsa/port.c
> > @@ -1620,8 +1620,10 @@ int dsa_port_link_register_of(struct dsa_port *dp)
> > if (ds->ops->phylink_mac_link_down)
> > ds->ops->phylink_mac_link_down(ds, port,
> > MLO_AN_FIXED, PHY_INTERFACE_MODE_NA);
> > + of_node_put(phy_np);
> > return dsa_port_phylink_register(dp);
> > }
> > + of_node_put(phy_np);
> > return 0;
> > }
> >
> > --
> > 2.29.0
> >
>
> Thanks for the patch.
>
> commit fc06b2867f4cea543505acfb194c2be4ebf0c7d3
> Author: Miaoqian Lin <linmq006@gmail.com>
> Date: Wed Apr 20 19:04:08 2022 +0800
>
> net: dsa: Add missing of_node_put() in dsa_port_link_register_of
>
> The device_node pointer is returned by of_parse_phandle() with refcount
> incremented. We should use of_node_put() on it when done.
> of_node_put() will check for NULL value.
>
> Fixes: a20f997010c4 ("net: dsa: Don't instantiate phylink for CPU/DSA ports unless needed")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
Great, I'll rebase then and I can drop my patch.
Thanks,
Marcin
prev parent reply other threads:[~2022-04-27 17:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 9:47 [net: PATCH] net: dsa: add missing refcount decrementation Marcin Wojtas
2022-04-27 17:25 ` Vladimir Oltean
2022-04-27 17:38 ` Marcin Wojtas [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='CAPv3WKeFudAqSrPbxeFLvs=myo1UDhBo+GPOZ6dGgpwC-eq8eg@mail.gmail.com' \
--to=mw@semihalf.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=upstream@semihalf.com \
--cc=vivien.didelot@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;
as well as URLs for NNTP newsgroup(s).