dsa: mv88e6xxx: Fix error handling in mv88e6xxx_set_port_state
Return correct error code if _mv88e6xxx_reg_read returns an error.
Fixes: facd95b2e0
("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>
This commit is contained in:
parent
540207ae69
commit
538cc282a3
|
@ -908,8 +908,10 @@ static int mv88e6xxx_set_port_state(struct dsa_switch *ds, int port, u8 state)
|
||||||
mutex_lock(&ps->smi_mutex);
|
mutex_lock(&ps->smi_mutex);
|
||||||
|
|
||||||
reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_CONTROL);
|
reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_CONTROL);
|
||||||
if (reg < 0)
|
if (reg < 0) {
|
||||||
|
ret = reg;
|
||||||
goto abort;
|
goto abort;
|
||||||
|
}
|
||||||
|
|
||||||
oldstate = reg & PORT_CONTROL_STATE_MASK;
|
oldstate = reg & PORT_CONTROL_STATE_MASK;
|
||||||
if (oldstate != state) {
|
if (oldstate != state) {
|
||||||
|
|
Loading…
Reference in a new issue