net: dsa: loop: Fix uninitialized pvid variable
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 5 Apr 2017 18:19:30 +0000 (11:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Apr 2017 20:33:17 +0000 (13:33 -0700)
Dan's static analyzer reported the following:

drivers/net/dsa/dsa_loop.c:181 dsa_loop_port_vlan_del()
error: XXX uninitialized symbol 'pvid'.

we were missing the assignment of pvid to ps->vid, so add that.

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>
drivers/net/dsa/dsa_loop.c

index bc5acc15edbf21cca000dbe87c94048a83d8cc16..ee55a902fa66ed6367c92af4d1e4e42ae26cf73c 100644 (file)
@@ -164,7 +164,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
        struct dsa_loop_priv *ps = ds->priv;
        struct mii_bus *bus = ps->bus;
        struct dsa_loop_vlan *vl;
-       u16 vid, pvid;
+       u16 vid, pvid = ps->pvid;
 
        dev_dbg(ds->dev, "%s\n", __func__);