iommu/arm-smmu: qcom_iommu: Add of_node_put() when breaking out of loop
Subsystems (4)
PATCH 1/1 iommu/arm-smmu: qcom_iommu: Add of_node_put() when breaking out of loop
In qcom_iommu_has_secure_context(), we should call of_node_put() for the reference 'child' when breaking out of for_each_child_of_node() which will automatically increase and decrease the refcount.
Fixes d051f28c8807 ("iommu/qcom: Initialize secure page table")
Signed-off-by Liang He <[email protected]>
--- drivers/iommu/arm/arm-smmu/qcom_iommu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/iommu/arm/arm-smmu/qcom_iommu.c +3 -1
@@ -740,8 +740,10 @@ static bool qcom_iommu_has_secure_context(struct qcom_iommu_dev *qcom_iommu)struct device_node *child;for_each_child_of_node (qcom_iommu->dev->of_node, child) -if (of_device_is_compatible (child,"qcom,msm-iommu-v1-sec" )) +if (of_device_is_compatible (child,"qcom,msm-iommu-v1-sec" )) { +of_node_put (child);return true; + }return false; }
Signature · 1 line
2.25.1
Quoted 5 lines · Liang He
In
qcom_iommu_has_secure_context(), we should callof_node_put()for the reference 'child' when breaking out offor_each_child_of_node()which will automatically increase and decrease the refcount.
Applied to will (for-joerg/arm-smmu/updates), thanks!
[1/1] iommu/arm-smmu: qcom_iommu: Add of_node_put() when breaking out of loop
https://git.kernel.org/will/c/a91eb6803c1c
Cheers,
Signature · 5 lines
Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev