All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@arm.linux.org.uk>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: devicetree@vger.kernel.org, Frank Rowand <frowand.list@gmail.com>,
	Grant Likely <grant.likely@linaro.org>,
	Iyappan Subramanian <isubramanian@apm.com>,
	Keyur Chudgar <kchudgar@apm.com>,
	linux-arm-kernel@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org, Li Yang <leoli@freescale.com>,
	Michal Simek <michal.simek@xilinx.com>,
	netdev@vger.kernel.org, Robert Richter <rric@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	"Soren Brinkmann" <soren.brinkmann@xilinx.com>,
	Sunil Goutham <sgoutham@cavium.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 6/7] phy: fixed-phy: properly validate phy in fixed_phy_update_state()
Date: Fri, 18 Sep 2015 10:55:22 +0100	[thread overview]
Message-ID: <E1ZcsO2-0001G2-G9@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20150918094625.GB21084@n2100.arm.linux.org.uk>

Validate that the phy_device passed into fixed_phy_update_state() is a
fixed-phy device before walking the list of phys for a fixed phy at the
same address.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/net/phy/fixed_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index fb1299c6326e..e23bf5b90e17 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -220,7 +220,7 @@ int fixed_phy_update_state(struct phy_device *phydev,
 	struct fixed_mdio_bus *fmb = &platform_fmb;
 	struct fixed_phy *fp;
 
-	if (!phydev || !phydev->bus)
+	if (!phydev || phydev->bus != fmb->mii_bus)
 		return -EINVAL;
 
 	list_for_each_entry(fp, &fmb->phys, node) {
-- 
2.1.0

WARNING: multiple messages have this Message-ID (diff)
From: rmk+kernel@arm.linux.org.uk (Russell King)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/7] phy: fixed-phy: properly validate phy in fixed_phy_update_state()
Date: Fri, 18 Sep 2015 10:55:22 +0100	[thread overview]
Message-ID: <E1ZcsO2-0001G2-G9@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20150918094625.GB21084@n2100.arm.linux.org.uk>

Validate that the phy_device passed into fixed_phy_update_state() is a
fixed-phy device before walking the list of phys for a fixed phy at the
same address.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 drivers/net/phy/fixed_phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/fixed_phy.c b/drivers/net/phy/fixed_phy.c
index fb1299c6326e..e23bf5b90e17 100644
--- a/drivers/net/phy/fixed_phy.c
+++ b/drivers/net/phy/fixed_phy.c
@@ -220,7 +220,7 @@ int fixed_phy_update_state(struct phy_device *phydev,
 	struct fixed_mdio_bus *fmb = &platform_fmb;
 	struct fixed_phy *fp;
 
-	if (!phydev || !phydev->bus)
+	if (!phydev || phydev->bus != fmb->mii_bus)
 		return -EINVAL;
 
 	list_for_each_entry(fp, &fmb->phys, node) {
-- 
2.1.0

  parent reply	other threads:[~2015-09-18  9:56 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18  9:46 [PATCH 0/7] Phy and mdiobus fixes Russell King - ARM Linux
2015-09-18  9:46 ` Russell King - ARM Linux
2015-09-18  9:47 ` [PATCH 1/7] phy: fix of_mdio_find_bus() device refcount leak Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47 ` [PATCH 2/7] phy: fix mdiobus module safety Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47 ` [PATCH 3/7] phy: add proper phy struct device refcounting Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47 ` [PATCH 4/7] of_mdio: fix MDIO phy " Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47 ` [PATCH 5/7] net: fix phy refcounting in a bunch of drivers Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47 ` [PATCH 6/7] phy: fixed-phy: properly validate phy in fixed_phy_update_state() Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47 ` [PATCH 7/7] phy: add phy_device_remove() Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:47   ` Russell King
2015-09-18  9:54 ` [PATCH 1/7] phy: fix of_mdio_find_bus() device refcount leak Russell King
2015-09-18  9:54   ` Russell King
2015-09-21 19:01   ` David Miller
2015-09-21 19:01     ` David Miller
2015-09-21 19:32     ` Russell King - ARM Linux
2015-09-21 19:32       ` Russell King - ARM Linux
2015-09-21 19:32       ` Russell King - ARM Linux
2015-09-21 22:08       ` David Miller
2015-09-21 22:08         ` David Miller
2015-09-18  9:55 ` [PATCH 2/7] phy: fix mdiobus module safety Russell King
2015-09-18  9:55   ` Russell King
2015-09-18  9:55 ` [PATCH 3/7] phy: add proper phy struct device refcounting Russell King
2015-09-18  9:55   ` Russell King
2015-09-18  9:55 ` [PATCH 4/7] of_mdio: fix MDIO phy " Russell King
2015-09-18  9:55   ` Russell King
2015-09-18 14:40   ` Rob Herring
2015-09-18  9:55 ` [PATCH 5/7] net: fix phy refcounting in a bunch of drivers Russell King
2015-09-18  9:55   ` Russell King
2015-09-18  9:55 ` Russell King [this message]
2015-09-18  9:55   ` [PATCH 6/7] phy: fixed-phy: properly validate phy in fixed_phy_update_state() Russell King
2015-09-18  9:55 ` [PATCH 7/7] phy: add phy_device_remove() Russell King
2015-09-18  9:55   ` Russell King
2015-09-18  9:56 ` [PATCH 0/7] Phy and mdiobus fixes Russell King - ARM Linux
2015-09-18  9:56   ` Russell King - ARM Linux
2015-09-18  9:56   ` Russell King - ARM Linux
2015-09-18 15:01   ` Sören Brinkmann
2015-09-18 15:01     ` Sören Brinkmann
2015-09-18 15:01     ` Sören Brinkmann
2015-09-18 15:20     ` Russell King - ARM Linux
2015-09-18 15:20       ` Russell King - ARM Linux
2015-09-19 20:49 ` Florian Fainelli
2015-09-19 20:49   ` Florian Fainelli
2015-09-19 20:49   ` Florian Fainelli

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=E1ZcsO2-0001G2-G9@rmk-PC.arm.linux.org.uk \
    --to=rmk+kernel@arm.linux.org.uk \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=grant.likely@linaro.org \
    --cc=isubramanian@apm.com \
    --cc=kchudgar@apm.com \
    --cc=leoli@freescale.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rric@kernel.org \
    --cc=sgoutham@cavium.com \
    --cc=soren.brinkmann@xilinx.com \
    --cc=thomas.petazzoni@free-electrons.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.