iommu/arm-smmu: Check of_match_node for NULL

In ["iommu/arm-smmu: fix architecture version detection"] we added the
ability to determine the SMMU architecture version from DT match data by
using of_match_node, but neglected to check the return value for NULL.
Fix this.

Change-Id: Ib9049f2b2f1204b52bc07ba8caf075449af4cd35
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
This commit is contained in:
Mitchel Humpherys 2015-05-27 16:36:56 -07:00 committed by David Keitel
parent 7894ab1459
commit b80f203ede

View file

@ -2620,6 +2620,8 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev)
mutex_init(&smmu->atos_lock);
of_id = of_match_node(arm_smmu_of_match, dev->of_node);
if (!of_id)
return -ENODEV;
smmu->version = (enum arm_smmu_arch_version)of_id->data;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);