stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "SZ Lin (林上智)" <sz.lin@moxa.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
Subject: request for 4.4-stable: 86e1d5adcef96 ("net: ethernet: ti: cpsw: fix mdio device reference leak")
Date: Wed, 12 Sep 2018 20:49:40 +0800	[thread overview]
Message-ID: <20180912124940.GA9635@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

Hi Greg,

This patch is not marked for 4.4-stable, but it's already in 4.9 and 4.14 stable. 

Please apply to 4.4-stable.

This patch fixed leak of mdio device reference.

--
SZ Lin (林上智)

[-- Attachment #2: 0001-net-ethernet-ti-cpsw-fix-mdio-device-reference-leak.patch --]
[-- Type: text/x-diff, Size: 1243 bytes --]

>From e5d91862fcc58a45fb8c7c4ae63f37b97ffde17f Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Thu, 17 Nov 2016 17:39:59 +0100
Subject: [PATCH] net: ethernet: ti: cpsw: fix mdio device reference leak

commit 86e1d5adcef961eb383ce4eacbe0ef22f06e2045 upstream

Make sure to drop the reference taken by of_find_device_by_node() when
looking up an mdio device from a phy_id property during probe.

Fixes: 549985ee9c72 ("cpsw: simplify the setup of the register
pointers")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: SZ Lin (林上智) <sz.lin@moxa.com>
---
 drivers/net/ethernet/ti/cpsw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c1a4425b54e7..549f1f070eba 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2096,6 +2096,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
 			}
 			snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
 				 PHY_ID_FMT, mdio->name, phyid);
+			put_device(&mdio->dev);
 		} else {
 			dev_err(&pdev->dev, "No slave[%d] phy_id or fixed-link property\n", i);
 			goto no_phy_slave;
-- 
2.19.0


             reply	other threads:[~2018-09-12 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-12 12:49 SZ Lin (林上智) [this message]
2018-09-17 11:45 ` request for 4.4-stable: 86e1d5adcef96 ("net: ethernet: ti: cpsw: fix mdio device reference leak") Greg Kroah-Hartman

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=20180912124940.GA9635@localhost \
    --to=sz.lin@moxa.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    /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).