Skip to content

Commit

Permalink
dsa: mv88e6xxx: Fix error handling in mv88e6xxx_set_port_state
Browse files Browse the repository at this point in the history
Return correct error code if _mv88e6xxx_reg_read returns an error.

Fixes: facd95b ("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>
  • Loading branch information
Guenter Roeck authored and David S. Miller committed Apr 16, 2015
1 parent 540207a commit 538cc28
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/net/dsa/mv88e6xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 538cc28

Please sign in to comment.