Commit d1db799e authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller

net: dsa: loop: Initialize err in dsa_loop_vlan_dump

Dan's static checker reported the following:

	drivers/net/dsa/dsa_loop.c:223 dsa_loop_port_vlan_dump()
	error: uninitialized symbol 'err'.

which could happen if we do hit the continue statement for each iteration of
the loop. Initialize err to 0 here.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Fixes: 98cd1552 ("net: dsa: Mock-up driver")
Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5865ccce
...@@ -194,7 +194,7 @@ static int dsa_loop_port_vlan_dump(struct dsa_switch *ds, int port, ...@@ -194,7 +194,7 @@ static int dsa_loop_port_vlan_dump(struct dsa_switch *ds, int port,
struct mii_bus *bus = ps->bus; struct mii_bus *bus = ps->bus;
struct dsa_loop_vlan *vl; struct dsa_loop_vlan *vl;
u16 vid, vid_start = 0; u16 vid, vid_start = 0;
int err; int err = 0;
dev_dbg(ds->dev, "%s\n", __func__); dev_dbg(ds->dev, "%s\n", __func__);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment