Skip to content

Commit

Permalink
dsa: mv88e6xxx: Initialise the mutex as soon as it is created
Browse files Browse the repository at this point in the history
By initialising immediately it, we don't run the danger of using it
before it is initialised.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andrew Lunn authored and David S. Miller committed May 11, 2016
1 parent cb9b902 commit b681957
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/dsa/mv88e6xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3132,8 +3132,6 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)

ps->ds = ds;

mutex_init(&ps->smi_mutex);

INIT_WORK(&ps->bridge_work, mv88e6xxx_bridge_work);

if (mv88e6xxx_has(ps, MV88E6XXX_FLAG_EEPROM))
Expand Down Expand Up @@ -3580,6 +3578,7 @@ static const char *mv88e6xxx_probe(struct device *dsa_dev,
ps->bus = bus;
ps->sw_addr = sw_addr;
ps->info = info;
mutex_init(&ps->smi_mutex);

*priv = ps;

Expand Down

0 comments on commit b681957

Please sign in to comment.