net: dsa: Mock-up driver couple fixes
Subsystems (3)
cover net: dsa: Mock-up driver couple fixes
Thanks to Dan's static checker, a bunch of small issues were found in the code.
Florian Fainelli (2):
net: dsa: loop: Fix uninitialized pvid variable
net: dsa: loop: Initialize err in dsa_loop_vlan_dump
drivers/net/dsa/dsa_loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.9.3
PATCH 1/2 net: dsa: loop: Fix uninitialized pvid variable
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.
--- drivers/net/dsa/dsa_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/dsa_loop.c +1 -1
@@ -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__);
Signature · 1 line
2.9.3
PATCH 2/2 net: dsa: loop: Initialize err in dsa_loop_vlan_dump
In reply to Florian FainelliDan'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.
--- drivers/net/dsa/dsa_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/dsa_loop.c +1 -1
@@ -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__);
Signature · 1 line
2.9.3
David Miller
maintainerFrom: Florian Fainelli <[email protected]>
Date: Wed, 5 Apr 2017 11:19:29 -0700
Quoted 1 line
Thanks to Dan's static checker, a bunch of small issues were found in the code.
Series applied, thanks Florian.