Commit 538cc282 authored by Guenter Roeck's avatar Guenter Roeck Committed by David S. Miller

dsa: mv88e6xxx: Fix error handling in mv88e6xxx_set_port_state

Return correct error code if _mv88e6xxx_reg_read returns an error.

Fixes: facd95b2 ("net: dsa: mv88e6xxx: Add Hardware bridging support")
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 540207ae
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment