summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMohamad Haj Yahia <mohamad@mellanox.com>2016-05-03 16:13:56 +0200
committerDavid S. Miller <davem@davemloft.net>2016-05-04 20:04:47 +0200
commit761e205b559be52852d85e0db4a034c9f57965f9 (patch)
tree298b03456741834fec03a507b024bff9f1c08f10 /drivers
parentnet/mlx5: E-Switch, Replace vport spin lock with synchronize_irq() (diff)
downloadlinux-761e205b559be52852d85e0db4a034c9f57965f9.tar.xz
linux-761e205b559be52852d85e0db4a034c9f57965f9.zip
net/mlx5: E-Switch, Fix error flow memory leak
Fix memory leak in case query nic vport command failed. Fixes: 81848731ff40 ('net/mlx5: E-Switch, Add SR-IOV (FDB) support') Signed-off-by: Mohamad Haj Yahia <mohamad@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/eswitch.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
index f01903a99993..c975ff593dfc 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
@@ -646,7 +646,7 @@ static void esw_update_vport_addr_list(struct mlx5_eswitch *esw,
err = mlx5_query_nic_vport_mac_list(esw->dev, vport_num, list_type,
mac_list, &size);
if (err)
- return;
+ goto out;
esw_debug(esw->dev, "vport[%d] context update %s list size (%d)\n",
vport_num, is_uc ? "UC" : "MC", size);
@@ -674,6 +674,7 @@ static void esw_update_vport_addr_list(struct mlx5_eswitch *esw,
addr->vport = vport_num;
addr->action = MLX5_ACTION_ADD;
}
+out:
kfree(mac_list);
}