[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1535635028-10469-1-git-send-email-ruxandra.radulescu@nxp.com>
Date: Thu, 30 Aug 2018 16:17:08 +0300
From: Ioana Radulescu <ruxandra.radulescu@....com>
To: gregkh@...uxfoundation.org, netdev@...r.kernel.org
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
dan.carpenter@...cle.com, ioana.ciornei@....com
Subject: [PATCH] staging: fsl-dpaa2/ethsw: Fix uninitialized variables
Functions port_vlans_add() and port_vlans_del() could,
in theory, return an uninitialized variable. Fix this
by initializing the variable in question at declaration.
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@....com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
---
drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index ecdd3d8..c1616c3 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -717,7 +717,7 @@ static int port_vlans_add(struct net_device *netdev,
struct switchdev_trans *trans)
{
struct ethsw_port_priv *port_priv = netdev_priv(netdev);
- int vid, err;
+ int vid, err = 0;
if (netif_is_bridge_master(vlan->obj.orig_dev))
return -EOPNOTSUPP;
@@ -872,7 +872,7 @@ static int port_vlans_del(struct net_device *netdev,
const struct switchdev_obj_port_vlan *vlan)
{
struct ethsw_port_priv *port_priv = netdev_priv(netdev);
- int vid, err;
+ int vid, err = 0;
if (netif_is_bridge_master(vlan->obj.orig_dev))
return -EOPNOTSUPP;
--
2.7.4
Powered by blists - more mailing lists