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: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 98cd1552ea ("net: dsa: Mock-up driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Florian Fainelli 2017-04-05 11:19:31 -07:00 committed by David S. Miller
parent 5865ccce7e
commit d1db799e96
1 changed files with 1 additions and 1 deletions

View File

@ -194,7 +194,7 @@ static int dsa_loop_port_vlan_dump(struct dsa_switch *ds, int port,
struct mii_bus *bus = ps->bus;
struct dsa_loop_vlan *vl;
u16 vid, vid_start = 0;
int err;
int err = 0;
dev_dbg(ds->dev, "%s\n", __func__);