On 9/05/2017 2:13 PM, "Tom Rini" <tr...@konsulko.com> wrote:

The variable 'res' may be unused uninitialized if our call to
mv88e61xx_port_read (register read) fails and we goto the error
handling section.  In this case we set 'res' to -EIO to indicate why we
failed.

Cc: Joe Hershberger <joe.hershber...@ni.com>
Cc: Chris Packham <judge.pack...@gmail.com>
Cc: Kevin Smith <kevin.sm...@elecsyscorp.com>
Cc: Prafulla Wadaskar <prafu...@marvell.com>
Signed-off-by: Tom Rini <tr...@konsulko.com>
---
 drivers/net/phy/mv88e61xx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


Looks good.

Reviewed-by: Chris Packham <judge.pack...@gmail.com>


diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c
index a2fd1686fc3b..3d2f6b98ad0e 100644
--- a/drivers/net/phy/mv88e61xx.c
+++ b/drivers/net/phy/mv88e61xx.c
@@ -655,8 +655,10 @@ static int mv88e61xx_read_port_config(struct
phy_device *phydev, u8 port)
                do {
                        val = mv88e61xx_port_read(phydev, port,
                                                  PORT_REG_STATUS);
-                       if (val < 0)
+                       if (val < 0) {
+                               res = -EIO;
                                goto unforce;
+                       }
                        if (val & PORT_REG_STATUS_LINK)
                                break;
                } while (--timeout);
--
1.9.1
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to