summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fsl-dpaa2
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@nxp.com>2018-08-30 16:17:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-10 10:38:17 +0200
commit13b72b089b9c9520a6ebeb388436a9ee14322279 (patch)
tree579ae2eda6031b7a69ae88b6cc6b80e6b584f14d /drivers/staging/fsl-dpaa2
parentb972c798fbab3a17088e637b1bfb63972a0aaca7 (diff)
downloadblackbird-op-linux-13b72b089b9c9520a6ebeb388436a9ee14322279.tar.gz
blackbird-op-linux-13b72b089b9c9520a6ebeb388436a9ee14322279.zip
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@nxp.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fsl-dpaa2')
-rw-r--r--drivers/staging/fsl-dpaa2/ethsw/ethsw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index 0066ca3072c1..7a7ca67822c5 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;
OpenPOWER on IntegriCloud