diff options
author | Florian Fainelli <f.fainelli@gmail.com> | 2017-04-05 21:19:31 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-06 23:33:17 +0300 |
commit | d1db799e968bf6677ac88a90729945ce0eb3ede5 (patch) | |
tree | d136a749e2fdc5fa279c824cd48e659e2818bfb1 /drivers/net | |
parent | 5865ccce7eac9bb520d7dacfb48cb72764ed10c3 (diff) | |
download | linux-d1db799e968bf6677ac88a90729945ce0eb3ede5.tar.xz |
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: 98cd1552ea27 ("net: dsa: Mock-up driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/dsa/dsa_loop.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c index ee55a902fa66..f0fc4de4fc9a 100644 --- a/drivers/net/dsa/dsa_loop.c +++ b/drivers/net/dsa/dsa_loop.c @@ -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__); |