dsa: mv88e6xxx: Fix error handling in mv88e6xxx_set_port_state
authorGuenter Roeck <linux@roeck-us.net>
Thu, 16 Apr 2015 05:12:42 +0000 (22:12 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Apr 2015 16:12:55 +0000 (12:12 -0400)
Return correct error code if _mv88e6xxx_reg_read returns an error.

Fixes: facd95b2e0ec0 ("net: dsa: mv88e6xxx: Add Hardware bridging support")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx.c

index fc8d3b6ffe8e0b35e64ed2aaa78b342a1b86f66a..f64186a5f63453f38fac2d8c7921439f758796df 100644 (file)
@@ -908,8 +908,10 @@ static int mv88e6xxx_set_port_state(struct dsa_switch *ds, int port, u8 state)
        mutex_lock(&ps->smi_mutex);
 
        reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_CONTROL);
-       if (reg < 0)
+       if (reg < 0) {
+               ret = reg;
                goto abort;
+       }
 
        oldstate = reg & PORT_CONTROL_STATE_MASK;
        if (oldstate != state) {