linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: mdio_bus: Check ENOTSUPP instead of ENOSYS in mdiobus_register_reset
@ 2019-11-19 13:27 Michal Simek
  2019-11-19 18:04 ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2019-11-19 13:27 UTC (permalink / raw)
  To: linux-kernel, monstr, michal.simek, git
  Cc: Andrew Lunn, David S. Miller, Florian Fainelli, Heiner Kallweit, netdev

Origin patch was using ENOTSUPP instead of ENOSYS. Silently changing error
value ends up in an access to bad area on Microblaze with axi ethernet
driver.

Fixes: 1d4639567d97 ("mdio_bus: Fix PTR_ERR applied after initialization to constant")
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

I didn't track it down where exactly that access happens but the patch is
clearly just changing something without description.

The origin patch has been merged between rc7 and rc8 and would be good to
get this fix to v5.4.
---
 drivers/net/phy/mdio_bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index 35876562e32a..dbacb0031877 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -65,7 +65,7 @@ static int mdiobus_register_reset(struct mdio_device *mdiodev)
 		reset = devm_reset_control_get_exclusive(&mdiodev->dev,
 							 "phy");
 	if (IS_ERR(reset)) {
-		if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) == -ENOSYS)
+		if (PTR_ERR(reset) == -ENOENT || PTR_ERR(reset) == -ENOTSUPP)
 			reset = NULL;
 		else
 			return PTR_ERR(reset);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: mdio_bus: Check ENOTSUPP instead of ENOSYS in mdiobus_register_reset
  2019-11-19 13:27 [PATCH] phy: mdio_bus: Check ENOTSUPP instead of ENOSYS in mdiobus_register_reset Michal Simek
@ 2019-11-19 18:04 ` Florian Fainelli
  2019-11-20  6:47   ` Michal Simek
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2019-11-19 18:04 UTC (permalink / raw)
  To: Michal Simek, linux-kernel, monstr, git
  Cc: Andrew Lunn, David S. Miller, Heiner Kallweit, netdev

On 11/19/19 5:27 AM, Michal Simek wrote:
> Origin patch was using ENOTSUPP instead of ENOSYS. Silently changing error
> value ends up in an access to bad area on Microblaze with axi ethernet
> driver.
> 
> Fixes: 1d4639567d97 ("mdio_bus: Fix PTR_ERR applied after initialization to constant")
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>

This has been fixed in the "net" tree already:

https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=075e238d12c21c8bde700d21fb48be7a3aa80194
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: mdio_bus: Check ENOTSUPP instead of ENOSYS in mdiobus_register_reset
  2019-11-19 18:04 ` Florian Fainelli
@ 2019-11-20  6:47   ` Michal Simek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Simek @ 2019-11-20  6:47 UTC (permalink / raw)
  To: Florian Fainelli, Michal Simek, linux-kernel, monstr, git
  Cc: Andrew Lunn, David S. Miller, Heiner Kallweit, netdev

On 19. 11. 19 19:04, Florian Fainelli wrote:
> On 11/19/19 5:27 AM, Michal Simek wrote:
>> Origin patch was using ENOTSUPP instead of ENOSYS. Silently changing error
>> value ends up in an access to bad area on Microblaze with axi ethernet
>> driver.
>>
>> Fixes: 1d4639567d97 ("mdio_bus: Fix PTR_ERR applied after initialization to constant")
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> 
> This has been fixed in the "net" tree already:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git/commit/?id=075e238d12c21c8bde700d21fb48be7a3aa80194
> 

Works for me.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-20  6:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 13:27 [PATCH] phy: mdio_bus: Check ENOTSUPP instead of ENOSYS in mdiobus_register_reset Michal Simek
2019-11-19 18:04 ` Florian Fainelli
2019-11-20  6:47   ` Michal Simek

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).