提交 c3ffe6d2 编写于 作者: G Geert Uytterhoeven 提交者: David S. Miller

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: NGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 213dd74a
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册