Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f8a02a4 authored by Gal Pressman's avatar Gal Pressman Committed by David S. Miller
Browse files

net/mlx5: Unmap only the relevant IO memory mapping



When freeing UAR the driver tries to unmap uar->map and uar->bf_map
which are mutually exclusive thus always unmapping a NULL pointer.
Make sure we only call iounmap() once, for the actual mapping.

Fixes: 0ba42241 ('net/mlx5: Fix global UAR mapping')
Signed-off-by: default avatarGal Pressman <galp@mellanox.com>
Reported-by: default avatarDoron Tsur <doront@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6071bd1a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -269,7 +269,9 @@ EXPORT_SYMBOL(mlx5_alloc_map_uar);

void mlx5_unmap_free_uar(struct mlx5_core_dev *mdev, struct mlx5_uar *uar)
{
	if (uar->map)
		iounmap(uar->map);
	else
		iounmap(uar->bf_map);
	mlx5_cmd_free_uar(mdev, uar->index);
}