Skip to contentSkip to conversation

mlx4_core: fix memory leak at multi_func_cleanup

PATCH Applied Yevgeny Petrilin 2 participants 2 messages Feb 6, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 mlx4_core: fix memory leak at multi_func_cleanup

From: Eugenia Emantayev <[email protected]>

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

---
 drivers/net/ethernet/mellanox/mlx4/cmd.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/mellanox/mlx4/cmd.c +5 -5
index 405e6ac..eaf09d4 100644
@@ -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)
Signature · 1 line
1.5.4.3