Skip to content

Commit

Permalink
mlx4_core: fix mtt range deallocation
Browse files Browse the repository at this point in the history
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 <yinghai@kernel.org>
Signed-off-by: Marcel Apfelbaum <marcela@mellanox.co.il>
Reviewed-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Tested-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marcel Apfelbaum authored and David S. Miller committed Jan 3, 2012
1 parent f7d9821 commit 1e27ca6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/mellanox/mlx4/mr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1e27ca6

Please sign in to comment.