diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2015-04-16 14:49:14 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-04-16 15:33:55 -0400 |
commit | c3ffe6d2c9733729307799a60e1ae09a9878e697 (patch) | |
tree | 7496e4cc824fcfb64270a751a2fb91b07fca74ff /drivers/net | |
parent | 213dd74aee765d4e5f3f4b9607fef0cf97faa2af (diff) |
net: dsa: mv88e6xxx: Add missing initialization in mv88e6xxx_set_port_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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/dsa/mv88e6xxx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index 12f186cb30cc..9f0c2b9d58ae 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c | |||
@@ -900,7 +900,7 @@ static int _mv88e6xxx_flush_fid(struct dsa_switch *ds, int fid) | |||
900 | static int mv88e6xxx_set_port_state(struct dsa_switch *ds, int port, u8 state) | 900 | static int mv88e6xxx_set_port_state(struct dsa_switch *ds, int port, u8 state) |
901 | { | 901 | { |
902 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); | 902 | struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); |
903 | int reg, ret; | 903 | int reg, ret = 0; |
904 | u8 oldstate; | 904 | u8 oldstate; |
905 | 905 | ||
906 | mutex_lock(&ps->smi_mutex); | 906 | mutex_lock(&ps->smi_mutex); |