summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mscc/ocelot.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven2018-06-07 15:10:30 +0200
committerDavid S. Miller2018-06-07 22:54:39 +0200
commit2ac0e1524d9585f5261cebecca262da6cedc1d85 (patch)
treee37e93c8debb78b6e27f7550c23aa9af1c597d46 /drivers/net/ethernet/mscc/ocelot.c
parentbonding: re-evaluate force_primary when the primary slave name changes (diff)
downloadkernel-qcow2-linux-2ac0e1524d9585f5261cebecca262da6cedc1d85.tar.gz
kernel-qcow2-linux-2ac0e1524d9585f5261cebecca262da6cedc1d85.tar.xz
kernel-qcow2-linux-2ac0e1524d9585f5261cebecca262da6cedc1d85.zip
net: mscc: ocelot: Fix uninitialized error in ocelot_netdevice_event()
With gcc-4.1.2: drivers/net/ethernet/mscc/ocelot.c: In function ‘ocelot_netdevice_event’: drivers/net/ethernet/mscc/ocelot.c:1129: warning: ‘ret’ may be used uninitialized in this function If the list iterated over by netdev_for_each_lower_dev() is empty, ret is never initialized, and converted into a notifier return value. Fix this by preinitializing ret to zero. Fixes: a556c76adc052c97 ("net: mscc: Add initial Ocelot switch support") Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc/ocelot.c')
-rw-r--r--drivers/net/ethernet/mscc/ocelot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index c8c74aa548d9..fb2c8f8071e6 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -1126,7 +1126,7 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
{
struct netdev_notifier_changeupper_info *info = ptr;
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
- int ret;
+ int ret = 0;
if (netif_is_lag_master(dev)) {
struct net_device *slave;