Commit 3c117b54 authored by Robin Murphy's avatar Robin Murphy Committed by Joerg Roedel

iommu/arm-smmu: Check that iommu_fwspecs are ours

We seem to have forgotten to check that iommu_fwspecs actually belong to
us before we go ahead and dereference their private data. Oops.

Fixes: 021bb842 ("iommu/arm-smmu: Wire up generic configuration support")
Signed-off-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent ec615f43
...@@ -1400,7 +1400,7 @@ static int arm_smmu_add_device(struct device *dev) ...@@ -1400,7 +1400,7 @@ static int arm_smmu_add_device(struct device *dev)
fwspec = dev->iommu_fwspec; fwspec = dev->iommu_fwspec;
if (ret) if (ret)
goto out_free; goto out_free;
} else if (fwspec) { } else if (fwspec && fwspec->ops == &arm_smmu_ops) {
smmu = arm_smmu_get_by_node(to_of_node(fwspec->iommu_fwnode)); smmu = arm_smmu_get_by_node(to_of_node(fwspec->iommu_fwnode));
} else { } else {
return -ENODEV; return -ENODEV;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment