Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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) {