net: dsa: mv88e6xxx: missing unlock on error path
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 14 Aug 2018 09:09:05 +0000 (12:09 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Aug 2018 17:08:07 +0000 (10:08 -0700)
We added a new error path, but we need to drop the lock before we return.

Fixes: 2d2e1dd29962 ("net: dsa: mv88e6xxx: Cache the port cmode")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mv88e6xxx/chip.c

index 17752316ab1027ad3f8bb54e6083f8b69de96ca0..8da3d39e321890726bd3c0270153bde685842942 100644 (file)
@@ -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;
                }