Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 1dbd83f3 authored by Liam Mark's avatar Liam Mark
Browse files

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: default avatarLiam Mark <lmark@codeaurora.org>
parent 83b2445d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment