mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-08 14:54:23 +08:00
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>
This commit is contained in:
parent
b972c798fb
commit
13b72b089b
@ -717,7 +717,7 @@ static int port_vlans_add(struct net_device *netdev,
|
|||||||
struct switchdev_trans *trans)
|
struct switchdev_trans *trans)
|
||||||
{
|
{
|
||||||
struct ethsw_port_priv *port_priv = netdev_priv(netdev);
|
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))
|
if (netif_is_bridge_master(vlan->obj.orig_dev))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
@ -872,7 +872,7 @@ static int port_vlans_del(struct net_device *netdev,
|
|||||||
const struct switchdev_obj_port_vlan *vlan)
|
const struct switchdev_obj_port_vlan *vlan)
|
||||||
{
|
{
|
||||||
struct ethsw_port_priv *port_priv = netdev_priv(netdev);
|
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))
|
if (netif_is_bridge_master(vlan->obj.orig_dev))
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
Loading…
Reference in New Issue
Block a user