Skip to content

Commit

Permalink
iommu/arm-smmu: Check that iommu_fwspecs are ours
Browse files Browse the repository at this point in the history
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: 021bb84 ("iommu/arm-smmu: Wire up generic configuration support")
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Robin Murphy authored and Joerg Roedel committed Nov 8, 2016
1 parent ec615f4 commit 3c117b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/arm-smmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ static int arm_smmu_add_device(struct device *dev)
fwspec = dev->iommu_fwspec;
if (ret)
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));
} else {
return -ENODEV;
Expand Down

0 comments on commit 3c117b5

Please sign in to comment.