arm64: dma_mapping: dma-mapping: Fix leak of dma_iommu_mapping
Currently arm_iommu_attach_device increments the reference count of the
dma_iommu_mapping object but arm_iommu_detach_device does not decrement
the reference count. This means that if a client calls
arm_iommu_attach_device/arm_iommu_detach_device more than once before
calling arm_iommu_release_mapping then the dma_iommu_mapping object will
be leaked.
We don't support having multiple devices attached to the same domain
concurently. So fix this issue by having neither arm_iommu_attach_device
or arm_iommu_detach_device change the reference count of the
dma_iommu_mapping object as that seems to have been the intension of the
original commit 1748f086a39c ("arm64: dma-mapping: Support attach after
detach case").
Change-Id: If21990ef1357742426503f71a9ff77aa0813668e
Signed-off-by:
Liam Mark <lmark@codeaurora.org>
Loading
Please register or sign in to comment