From: Guenter Roeck Date: Thu, 16 Apr 2015 05:12:42 +0000 (-0700) Subject: dsa: mv88e6xxx: Fix error handling in mv88e6xxx_set_port_state X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=538cc282a3efb62cdb62ff9e6e44918c11a3c886;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Andrew Lunn Reported-by: kbuild test robot Signed-off-by: David S. Miller --- 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) 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) {