提交 1e27ca69 编写于 作者: M Marcel Apfelbaum 提交者: David S. Miller

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: NYinghai Lu <yinghai@kernel.org>
Signed-off-by: NMarcel Apfelbaum <marcela@mellanox.co.il>
Reviewed-by: NJack Morgenstein <jackm@dev.mellanox.co.il>
Tested-by: NYinghai Lu <yinghai@kernel.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f7d9821a
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册