diff options
author | Guenter Roeck <linux@roeck-us.net> | 2015-04-16 01:12:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-16 12:12:55 -0400 |
commit | 538cc282a3efb62cdb62ff9e6e44918c11a3c886 (patch) | |
tree | 42aa6fa23f9560c9b387a793c49891ab10602be0 /drivers/net | |
parent | 540207ae69777b85d167df28f469e77f0fcbb8f9 (diff) |
dsa: mv88e6xxx: Fix error handling in mv88e6xxx_set_port_state
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index fc8d3b6ffe8e..f64186a5f634 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c | |||
@@ -908,8 +908,10 @@ static int mv88e6xxx_set_port_state(struct dsa_switch *ds, int port, u8 state) | |||
908 | mutex_lock(&ps->smi_mutex); | 908 | mutex_lock(&ps->smi_mutex); |
909 | 909 | ||
910 | reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_CONTROL); | 910 | reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_CONTROL); |
911 | if (reg < 0) | 911 | if (reg < 0) { |
912 | ret = reg; | ||
912 | goto abort; | 913 | goto abort; |
914 | } | ||
913 | 915 | ||
914 | oldstate = reg & PORT_CONTROL_STATE_MASK; | 916 | oldstate = reg & PORT_CONTROL_STATE_MASK; |
915 | if (oldstate != state) { | 917 | if (oldstate != state) { |