diff mbox

[net,1/3] mlx4_core: fix memory leak at multi_func_cleanup

Message ID 4F2FFF29.2030701@mellanox.co.il
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Yevgeny Petrilin Feb. 6, 2012, 4:26 p.m. UTC
From: Eugenia Emantayev <eugenia@mellanox.co.il>

Perform cleanup also in non-master flow.
The VFs use communication channel as well.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
---
 drivers/net/ethernet/mellanox/mlx4/cmd.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Comments

David Miller Feb. 6, 2012, 5:13 p.m. UTC | #1
From: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Date: Mon, 6 Feb 2012 18:26:17 +0200

> From: Eugenia Emantayev <eugenia@mellanox.co.il>
> 
> Perform cleanup also in non-master flow.
> The VFs use communication channel as well.
> 
> Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c
index 405e6ac..eaf09d4 100644
--- a/drivers/net/ethernet/mellanox/mlx4/cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c
@@ -1616,12 +1616,12 @@  void mlx4_multi_func_cleanup(struct mlx4_dev *dev)
 				kfree(priv->mfunc.master.slave_state[i].vlan_filter[port]);
 		}
 		kfree(priv->mfunc.master.slave_state);
-		iounmap(priv->mfunc.comm);
-		dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE,
-						     priv->mfunc.vhcr,
-						     priv->mfunc.vhcr_dma);
-		priv->mfunc.vhcr = NULL;
 	}
+
+	iounmap(priv->mfunc.comm);
+	dma_free_coherent(&(dev->pdev->dev), PAGE_SIZE,
+		     priv->mfunc.vhcr, priv->mfunc.vhcr_dma);
+	priv->mfunc.vhcr = NULL;
 }
 
 void mlx4_cmd_cleanup(struct mlx4_dev *dev)