From: David Miller <davem@davemloft.net>
To: u.kleine-koenig@pengutronix.de
Cc: netdev@vger.kernel.org, claudiu.manoil@freescale.com,
kernel@pengutronix.de, f.fainelli@gmail.com,
fabio.estevam@freescale.com, thomas.petazzoni@free-electrons.com
Subject: Re: [PATCH v4] net: gianfar: fix reference counting for phy_node
Date: Thu, 07 Aug 2014 16:06:09 -0700 (PDT) [thread overview]
Message-ID: <20140807.160609.329034989608056160.davem@davemloft.net> (raw)
In-Reply-To: <1407442627-1508-1-git-send-email-u.kleine-koenig@pengutronix.de>
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Thu, 7 Aug 2014 22:17:07 +0200
> The line before the changed if condition is:
>
> priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
>
> . If this call succeeds priv->phy_node must not be overwritten in the if
> block; otherwise the reference to the node returned by of_parse_phandle
> is lost. So add a check that the if block isn't executed in this case.
>
> Furthermore in the fixed phy case no reference is aquired for phy_node
> resulting in an of_node_put without holding a reference. To fix that,
> get a reference on the MAC dt node.
>
> Fixes: be40364544bd ("gianfar: use the new fixed PHY helpers")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Applied.
prev parent reply other threads:[~2014-08-07 23:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-07 19:35 [PATCH] net: gianfar: fix reference counting for phy_node Uwe Kleine-König
2014-08-07 19:41 ` [PATCH v2] " Uwe Kleine-König
2014-08-07 20:01 ` [PATCH v3] " Uwe Kleine-König
2014-08-07 20:17 ` [PATCH v4] " Uwe Kleine-König
2014-08-07 23:06 ` David Miller [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=20140807.160609.329034989608056160.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=claudiu.manoil@freescale.com \
--cc=f.fainelli@gmail.com \
--cc=fabio.estevam@freescale.com \
--cc=kernel@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=thomas.petazzoni@free-electrons.com \
--cc=u.kleine-koenig@pengutronix.de \
/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).