summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Cohen <eli@dev.mellanox.co.il>2013-10-31 15:26:33 +0200
committerRoland Dreier <roland@purestorage.com>2013-11-15 14:36:35 -0800
commit2b136d025348774633a2f6fc2a87f0cf409a3ab9 (patch)
tree9d66d199f81bb4d9b37a0802e97b0cacaca9b884
parent7e2e19210a8bbbcacd31e8ce4a0ea64e3ac37dea (diff)
IB/mlx5: Fix list_del of empty list
For archs with pages size of 4K, when the chunk is freed, fwp is not in the list so avoid attempting to delete it. Signed-off-by: Eli Cohen <eli@mellanox.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
index ba816c25c5c1..37b6ad1f9a1b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
@@ -229,7 +229,8 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr)
set_bit(n, &fwp->bitmask);
if (fwp->free_count == MLX5_NUM_4K_IN_PAGE) {
rb_erase(&fwp->rb_node, &dev->priv.page_root);
- list_del(&fwp->list);
+ if (fwp->free_count != 1)
+ list_del(&fwp->list);
dma_unmap_page(&dev->pdev->dev, addr, PAGE_SIZE, DMA_BIDIRECTIONAL);
__free_page(fwp->page);
kfree(fwp);