mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] net: phy: bcm84881: Fix some error handling paths
@ 2024-10-03 19:03 Christophe JAILLET
  2024-10-03 19:04 ` Florian Fainelli
  2024-10-04 23:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2024-10-03 19:03 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
	Florian Fainelli, netdev

If phy_read_mmd() fails, the error code stored in 'bmsr' should be returned
instead of 'val' which is likely to be 0.

Fixes: 75f4d8d10e01 ("net: phy: add Broadcom BCM84881 PHY driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch is speculative.
---
 drivers/net/phy/bcm84881.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/bcm84881.c b/drivers/net/phy/bcm84881.c
index f1d47c264058..97da3aee4942 100644
--- a/drivers/net/phy/bcm84881.c
+++ b/drivers/net/phy/bcm84881.c
@@ -132,7 +132,7 @@ static int bcm84881_aneg_done(struct phy_device *phydev)
 
 	bmsr = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_C22 + MII_BMSR);
 	if (bmsr < 0)
-		return val;
+		return bmsr;
 
 	return !!(val & MDIO_AN_STAT1_COMPLETE) &&
 	       !!(bmsr & BMSR_ANEGCOMPLETE);
@@ -158,7 +158,7 @@ static int bcm84881_read_status(struct phy_device *phydev)
 
 	bmsr = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_AN_C22 + MII_BMSR);
 	if (bmsr < 0)
-		return val;
+		return bmsr;
 
 	phydev->autoneg_complete = !!(val & MDIO_AN_STAT1_COMPLETE) &&
 				   !!(bmsr & BMSR_ANEGCOMPLETE);
-- 
2.46.2


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

* Re: [PATCH net] net: phy: bcm84881: Fix some error handling paths
  2024-10-03 19:03 [PATCH net] net: phy: bcm84881: Fix some error handling paths Christophe JAILLET
@ 2024-10-03 19:04 ` Florian Fainelli
  2024-10-04 23:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2024-10-03 19:04 UTC (permalink / raw)
  To: Christophe JAILLET, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni
  Cc: linux-kernel, kernel-janitors, netdev

On 10/3/24 12:03, Christophe JAILLET wrote:
> If phy_read_mmd() fails, the error code stored in 'bmsr' should be returned
> instead of 'val' which is likely to be 0.
> 
> Fixes: 75f4d8d10e01 ("net: phy: add Broadcom BCM84881 PHY driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
--
Florian

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

* Re: [PATCH net] net: phy: bcm84881: Fix some error handling paths
  2024-10-03 19:03 [PATCH net] net: phy: bcm84881: Fix some error handling paths Christophe JAILLET
  2024-10-03 19:04 ` Florian Fainelli
@ 2024-10-04 23:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-04 23:30 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: florian.fainelli, bcm-kernel-feedback-list, andrew, hkallweit1,
	linux, davem, edumazet, kuba, pabeni, linux-kernel,
	kernel-janitors, f.fainelli, netdev

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu,  3 Oct 2024 21:03:21 +0200 you wrote:
> If phy_read_mmd() fails, the error code stored in 'bmsr' should be returned
> instead of 'val' which is likely to be 0.
> 
> Fixes: 75f4d8d10e01 ("net: phy: add Broadcom BCM84881 PHY driver")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This patch is speculative.
> 
> [...]

Here is the summary with links:
  - [net] net: phy: bcm84881: Fix some error handling paths
    https://git.kernel.org/netdev/net/c/9234a2549cb6

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2024-10-04 23:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-03 19:03 [PATCH net] net: phy: bcm84881: Fix some error handling paths Christophe JAILLET
2024-10-03 19:04 ` Florian Fainelli
2024-10-04 23:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®