]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
IB/mlx5: Replace kfree with kvfree
authorChuhong Yuan <hslester96@gmail.com>
Wed, 17 Jul 2019 08:21:01 +0000 (16:21 +0800)
committerSasha Levin <sashal@kernel.org>
Sun, 25 Aug 2019 14:10:24 +0000 (10:10 -0400)
[ Upstream commit b7f406bb883ba7ac3222298f6b44cebc4cfe2dde ]

Memory allocated by kvzalloc should not be freed by kfree(), use kvfree()
instead.

Fixes: 813e90b1aeaa ("IB/mlx5: Add advise_mr() support")
Link: https://lore.kernel.org/r/20190717082101.14196-1-hslester96@gmail.com
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/odp.c

index 91507a2e92900f94d30fa8231df0fd1b5d184b82..f6e5351ba4d509274faefafd5b7424aed176118d 100644 (file)
@@ -1765,7 +1765,7 @@ static void mlx5_ib_prefetch_mr_work(struct work_struct *work)
 
        num_pending_prefetch_dec(to_mdev(w->pd->device), w->sg_list,
                                 w->num_sge, 0);
-       kfree(w);
+       kvfree(w);
 }
 
 int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd,
@@ -1807,7 +1807,7 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd,
        if (valid_req)
                queue_work(system_unbound_wq, &work->work);
        else
-               kfree(work);
+               kvfree(work);
 
        srcu_read_unlock(&dev->mr_srcu, srcu_key);