Skip to content

Commit

Permalink
net: dsa: mv88e6xxx: Add missing initialization in mv88e6xxx_set_port…
Browse files Browse the repository at this point in the history
…_state()

drivers/net/dsa/mv88e6xxx.c: In function ‘mv88e6xxx_set_port_state’:
drivers/net/dsa/mv88e6xxx.c:905: warning: ‘ret’ may be used uninitialized in this function

If oldstate == state, mv88e6xxx_set_port_state() will return an
uninitialized value. Pre-initialize ret to zero to fix this.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Geert Uytterhoeven authored and David S. Miller committed Apr 16, 2015
1 parent 213dd74 commit c3ffe6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dsa/mv88e6xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ static int _mv88e6xxx_flush_fid(struct dsa_switch *ds, int fid)
static int mv88e6xxx_set_port_state(struct dsa_switch *ds, int port, u8 state)
{
struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
int reg, ret;
int reg, ret = 0;
u8 oldstate;

mutex_lock(&ps->smi_mutex);
Expand Down

0 comments on commit c3ffe6d

Please sign in to comment.