All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Madalin Bucur <madalin.bucur@nxp.com>,
	Timur Tabi <timur@codeaurora.org>, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Johan Hovold <johan@kernel.org>
Subject: [PATCH net v2 4/5] net: fsl/fman: fix fixed-link-phydev reference leak
Date: Thu, 24 Nov 2016 19:21:30 +0100	[thread overview]
Message-ID: <1480011691-13278-5-git-send-email-johan@kernel.org> (raw)
In-Reply-To: <1480011691-13278-1-git-send-email-johan@kernel.org>

Make sure to drop the reference taken by of_phy_find_device() when
looking up a fixed-link phydev during probe.

Fixes: 57ba4c9b56d8 ("fsl/fman: Add FMan MAC support")
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/net/ethernet/freescale/fman/mac.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index 8fe6b3e253fa..736db9d9b0ad 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -892,6 +892,8 @@ static int mac_probe(struct platform_device *_of_dev)
 		priv->fixed_link->duplex = phy->duplex;
 		priv->fixed_link->pause = phy->pause;
 		priv->fixed_link->asym_pause = phy->asym_pause;
+
+		put_device(&phy->mdio.dev);
 	}
 
 	err = mac_dev->init(mac_dev);
-- 
2.7.3

  parent reply	other threads:[~2016-11-24 18:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 18:21 [PATCH net v2 0/5] net: fix phydev reference leaks Johan Hovold
2016-11-24 18:21 ` [PATCH net v2 1/5] net: dsa: fix fixed-link-phy device leaks Johan Hovold
2016-11-24 18:21 ` [PATCH net v2 2/5] net: bcmgenet: fix phydev reference leak Johan Hovold
2016-11-24 18:21 ` [PATCH net v2 3/5] net: fsl/fman: " Johan Hovold
2016-11-24 18:21 ` Johan Hovold [this message]
2016-11-25 10:54   ` [PATCH net v2 4/5] net: fsl/fman: fix fixed-link-phydev " Madalin-Cristian Bucur
2016-11-24 18:21 ` [PATCH net v2 5/5] net: qcom/emac: fix of_node and phydev leaks Johan Hovold
2016-11-24 18:55   ` Timur Tabi
2017-01-09 19:49   ` Timur Tabi
2017-01-10  8:43     ` Johan Hovold
2016-11-28  1:02 ` [PATCH net v2 0/5] net: fix phydev reference leaks David Miller
2016-11-28  2:11   ` Timur Tabi
2016-11-28  4:53     ` David Miller

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=1480011691-13278-5-git-send-email-johan@kernel.org \
    --to=johan@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=timur@codeaurora.org \
    --cc=vivien.didelot@savoirfairelinux.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.