From 1e27ca69446e98b666b215b8ba71bf29281ce674 Mon Sep 17 00:00:00 2001 From: Marcel Apfelbaum Date: Mon, 2 Jan 2012 04:07:39 +0000 Subject: [PATCH] mlx4_core: fix mtt range deallocation The mtt range was allocated in mtt units but deallocated in segments. Among the rest, this caused crash during hotplug removal Reported-by: Yinghai Lu Signed-off-by: Marcel Apfelbaum Reviewed-by: Jack Morgenstein Tested-by: Yinghai Lu Signed-off-by: David S. Miller --- drivers/net/ethernet/mellanox/mlx4/mr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/mr.c b/drivers/net/ethernet/mellanox/mlx4/mr.c index f7243b26bdf5..01df5567e16e 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mr.c +++ b/drivers/net/ethernet/mellanox/mlx4/mr.c @@ -239,8 +239,8 @@ void __mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order) first_seg = offset / (1 << log_mtts_per_seg); mlx4_buddy_free(&mr_table->mtt_buddy, first_seg, seg_order); - mlx4_table_put_range(dev, &mr_table->mtt_table, first_seg, - first_seg + (1 << seg_order) - 1); + mlx4_table_put_range(dev, &mr_table->mtt_table, offset, + offset + (1 << order) - 1); } static void mlx4_free_mtt_range(struct mlx4_dev *dev, u32 offset, int order) -- 2.34.1