summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-08-01 02:18:38 -0400
committerJoerg Roedel <jroedel@suse.de>2016-08-09 11:27:48 -0400
commit423595e89ddf9b657812a33932a5e2ad1bb9dd54 (patch)
tree99623022f61aca32374c0c58a338da06cd17b0c2 /drivers/iommu
parent29b4817d4018df78086157ea3a55c1d9424a7cfc (diff)
iommu/exynos: Fix error handling for of_platform_device_create
of_platform_device_create returns NULL on error so an IS_ERR test is incorrect here and a NULL check is required. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; @@ e = of_platform_device_create(...); if( - IS_ERR(e) + !e ) { <+... return - PTR_ERR(e) + -ENODEV ; ...+> } Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/exynos-iommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 33dcc29ec200..30808e91b775 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
1345 exynos_iommu_init(); 1345 exynos_iommu_init();
1346 1346
1347 pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root); 1347 pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
1348 if (IS_ERR(pdev)) 1348 if (!pdev)
1349 return PTR_ERR(pdev); 1349 return -ENODEV;
1350 1350
1351 /* 1351 /*
1352 * use the first registered sysmmu device for performing 1352 * use the first registered sysmmu device for performing