* [PATCH] net:phy: Add a return value check on bus write
@ 2018-12-26 17:37 Aditya Pakki
2018-12-26 17:44 ` Heiner Kallweit
2018-12-26 17:50 ` Heiner Kallweit
0 siblings, 2 replies; 3+ messages in thread
From: Aditya Pakki @ 2018-12-26 17:37 UTC (permalink / raw)
To: pakki001
Cc: kjlu, Andrew Lunn, Florian Fainelli, Heiner Kallweit,
David S. Miller, Michal Simek, netdev, linux-arm-kernel,
linux-kernel
xgmiitorgmii_read_status() could fail when writing to the bus via
mdiobus_write(). The fix adds a check and returns an error in case
of failure.
Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
drivers/net/phy/xilinx_gmii2rgmii.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 74a8782313cf..926879d43373 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -58,7 +58,9 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev)
else
val |= BMCR_SPEED10;
- mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val);
+ err = mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val);
+ if (err)
+ return err;
return 0;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net:phy: Add a return value check on bus write
2018-12-26 17:37 [PATCH] net:phy: Add a return value check on bus write Aditya Pakki
@ 2018-12-26 17:44 ` Heiner Kallweit
2018-12-26 17:50 ` Heiner Kallweit
1 sibling, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2018-12-26 17:44 UTC (permalink / raw)
To: Aditya Pakki
Cc: kjlu, Andrew Lunn, Florian Fainelli, David S. Miller,
Michal Simek, netdev, linux-arm-kernel, linux-kernel
On 26.12.2018 18:37, Aditya Pakki wrote:
> xgmiitorgmii_read_status() could fail when writing to the bus via
> mdiobus_write(). The fix adds a check and returns an error in case
> of failure.
>
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
> drivers/net/phy/xilinx_gmii2rgmii.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
> index 74a8782313cf..926879d43373 100644
> --- a/drivers/net/phy/xilinx_gmii2rgmii.c
> +++ b/drivers/net/phy/xilinx_gmii2rgmii.c
> @@ -58,7 +58,9 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev)
> else
> val |= BMCR_SPEED10;
>
> - mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val);
> + err = mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val);
> + if (err)
> + return err;
>
> return 0;
Why not simply:
return mdiobus_write(bus, addr, XILINX_GMII2RGMII_REG, val);
Heiner
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net:phy: Add a return value check on bus write
2018-12-26 17:37 [PATCH] net:phy: Add a return value check on bus write Aditya Pakki
2018-12-26 17:44 ` Heiner Kallweit
@ 2018-12-26 17:50 ` Heiner Kallweit
1 sibling, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2018-12-26 17:50 UTC (permalink / raw)
To: Aditya Pakki
Cc: kjlu, Andrew Lunn, Florian Fainelli, David S. Miller,
Michal Simek, netdev, linux-arm-kernel, linux-kernel
On 26.12.2018 18:37, Aditya Pakki wrote:
> xgmiitorgmii_read_status() could fail when writing to the bus via
> mdiobus_write(). The fix adds a check and returns an error in case
> of failure.
>
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
> ---
Two more things:
- subject should be: "net: phy: xgmiitorgmii: check bus write return value"
See also git history of this file.
- patch needs to be properly annotated as "net" or "net-next".
net-next is closed currently, please re-submit once it's open again in
~ 2-3 weeks.
Heiner
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-12-26 17:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26 17:37 [PATCH] net:phy: Add a return value check on bus write Aditya Pakki
2018-12-26 17:44 ` Heiner Kallweit
2018-12-26 17:50 ` Heiner Kallweit
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).