[net-next] net: dsa: mv88e6xxx: missing unlock on error path
diff mbox series

Message ID 20180814090905.rm6i665c5utl7d32@kili.mountain
State Accepted, archived
Delegated to: David Miller
Headers show
Series
  • [net-next] net: dsa: mv88e6xxx: missing unlock on error path
Related show

Commit Message

Dan Carpenter Aug. 14, 2018, 9:09 a.m. UTC
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>

Comments

Andrew Lunn Aug. 14, 2018, 1:42 p.m. UTC | #1
On Tue, Aug 14, 2018 at 12:09:05PM +0300, Dan Carpenter wrote:
> 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>

    Andrew
David Miller Aug. 14, 2018, 5:08 p.m. UTC | #2
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 14 Aug 2018 12:09:05 +0300

> 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>

Applied.

Patch
diff mbox series

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 17752316ab10..8da3d39e3218 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;
 		}