From: Colin Ian King Date: Mon, 25 Apr 2016 22:11:22 +0000 (+0100) Subject: net: dsa: mv88e6xxx: fix uninitialized error return X-Git-Tag: v4.6-rc7~38^2~20 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=1d9619d5337df6cf56eb66b6c8213d1317583513;p=linux-2.6-block.git net: dsa: mv88e6xxx: fix uninitialized error return The error return err is not initialized and there is a possibility that err is not assigned causing mv88e6xxx_port_bridge_join to return a garbage error return status. Fix this by initializing err to 0. Signed-off-by: Colin Ian King Reviewed-by: Vivien Didelot Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c index a2904029cccc..5e572b3510b9 100644 --- a/drivers/net/dsa/mv88e6xxx.c +++ b/drivers/net/dsa/mv88e6xxx.c @@ -2181,7 +2181,7 @@ int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, struct net_device *bridge) { struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); - int i, err; + int i, err = 0; mutex_lock(&ps->smi_mutex);