net/mlx4_en: Fix resource leak in error flow
authorDotan Barak <dotanb@dev.mellanox.com>
Tue, 25 Jun 2013 09:09:29 +0000 (12:09 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 25 Jun 2013 23:29:38 +0000 (16:29 -0700)
Wrong condition was used when calling iounmap.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_main.c

index a5c9df0..a071cda 100644 (file)
@@ -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);