Skip to content

Commit ae3df92

Browse files
Akhilesh Patilgregkh
authored andcommitted
RDMA/core: Free pfn_list with appropriate kvfree call
[ Upstream commit 111aea0 ] Ensure that pfn_list allocated by kvcalloc() is freed using corresponding kvfree() function. Match memory allocation and free routines kvcalloc -> kvfree. Fixes: 259e9bd ("RDMA/core: Avoid hmm_dma_map_alloc() for virtual DMA devices") Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in> Link: https://patch.msgid.link/aJjcPjL1BVh8QrMN@bhairav-test.ee.iitb.ac.in Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1adaa34 commit ae3df92

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/infiniband/core/umem_odp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static int ib_init_umem_odp(struct ib_umem_odp *umem_odp,
115115

116116
out_free_map:
117117
if (ib_uses_virt_dma(dev))
118-
kfree(map->pfn_list);
118+
kvfree(map->pfn_list);
119119
else
120120
hmm_dma_map_free(dev->dma_device, map);
121121
return ret;
@@ -287,7 +287,7 @@ static void ib_umem_odp_free(struct ib_umem_odp *umem_odp)
287287
mutex_unlock(&umem_odp->umem_mutex);
288288
mmu_interval_notifier_remove(&umem_odp->notifier);
289289
if (ib_uses_virt_dma(dev))
290-
kfree(umem_odp->map.pfn_list);
290+
kvfree(umem_odp->map.pfn_list);
291291
else
292292
hmm_dma_map_free(dev->dma_device, &umem_odp->map);
293293
}

0 commit comments

Comments
 (0)