Commit 111aea04 authored by Akhilesh Patil's avatar Akhilesh Patil Committed by Leon Romanovsky
Browse files

RDMA/core: Free pfn_list with appropriate kvfree call



Ensure that pfn_list allocated by kvcalloc() is freed using corresponding
kvfree() function. Match memory allocation and free routines kvcalloc -> kvfree.

Fixes: 259e9bd0 ("RDMA/core: Avoid hmm_dma_map_alloc() for virtual DMA devices")
Signed-off-by: default avatarAkhilesh Patil <akhilesh@ee.iitb.ac.in>
Link: https://patch.msgid.link/aJjcPjL1BVh8QrMN@bhairav-test.ee.iitb.ac.in


Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 2186e8c3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ static int ib_init_umem_odp(struct ib_umem_odp *umem_odp,

out_free_map:
	if (ib_uses_virt_dma(dev))
		kfree(map->pfn_list);
		kvfree(map->pfn_list);
	else
		hmm_dma_map_free(dev->dma_device, map);
	return ret;
@@ -287,7 +287,7 @@ static void ib_umem_odp_free(struct ib_umem_odp *umem_odp)
	mutex_unlock(&umem_odp->umem_mutex);
	mmu_interval_notifier_remove(&umem_odp->notifier);
	if (ib_uses_virt_dma(dev))
		kfree(umem_odp->map.pfn_list);
		kvfree(umem_odp->map.pfn_list);
	else
		hmm_dma_map_free(dev->dma_device, &umem_odp->map);
}