]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iommu/qcom: fix device leak on of_xlate()
authorJohan Hovold <johan@kernel.org>
Mon, 5 Jan 2026 16:09:11 +0000 (11:09 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:10:09 +0000 (13:10 +0100)
commit4c0278938c36e04a7dcbb525061a74c444067e92
tree1f6e0adf3b41d7706d0530064a2db83e742045d5
parent2e9a95d60f1df7b57618fd5ef057aef331575bd2
iommu/qcom: fix device leak on of_xlate()

[ Upstream commit 6a3908ce56e6879920b44ef136252b2f0c954194 ]

Make sure to drop the reference taken to the iommu platform device when
looking up its driver data during of_xlate().

Note that commit e2eae09939a8 ("iommu/qcom: add missing put_device()
call in qcom_iommu_of_xlate()") fixed the leak in a couple of error
paths, but the reference is still leaking on success and late failures.

Fixes: 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")
Cc: stable@vger.kernel.org # 4.14: e2eae09939a8
Cc: Rob Clark <robin.clark@oss.qualcomm.com>
Cc: Yu Kuai <yukuai3@huawei.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
[ adapted validation logic from max_asid to num_ctxs ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iommu/arm/arm-smmu/qcom_iommu.c