From 05ab205f02ddcfcafeb9ffa6c840144040c7cd2b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 14 Aug 2018 12:09:05 +0300 Subject: [PATCH] net: dsa: mv88e6xxx: missing unlock on error path We added a new error path, but we need to drop the lock before we return. Fixes: 8e4785d47b6d ("net: dsa: mv88e6xxx: Cache the port cmode") Signed-off-by: Dan Carpenter Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller --- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 17752316ab102..8da3d39e32189 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2408,7 +2408,7 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) if (chip->info->ops->port_get_cmode) { err = chip->info->ops->port_get_cmode(chip, i, &cmode); if (err) - return err; + goto unlock; chip->ports[i].cmode = cmode; } -- 2.39.5