Patchwork [V1,net-next,01/10] net/mlx4_en: Fix resource leak in error flow

login
register
mail settings
Submitter Or Gerlitz
Date June 25, 2013, 9:09 a.m.
Message ID <1372151378-21468-2-git-send-email-ogerlitz@mellanox.com>
Download mbox | patch
Permalink /patch/254063/
State Accepted
Delegated to: David Miller
Headers show

Comments

Or Gerlitz - June 25, 2013, 9:09 a.m.
From: Dotan Barak <dotanb@dev.mellanox.com>

Wrong condition was used when calling iounmap.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlx4/en_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_main.c b/drivers/net/ethernet/mellanox/mlx4/en_main.c
index a5c9df0..a071cda 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_main.c
@@ -310,7 +310,7 @@  static void *mlx4_en_add(struct mlx4_dev *dev)
 err_mr:
 	(void) mlx4_mr_free(dev, &mdev->mr);
 err_map:
-	if (!mdev->uar_map)
+	if (mdev->uar_map)
 		iounmap(mdev->uar_map);
 err_uar:
 	mlx4_uar_free(dev, &mdev->priv_uar);