Commit 423595e8 authored by Amitoj Kaur Chawla's avatar Amitoj Kaur Chawla Committed by Joerg Roedel

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: default avatarAmitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 29b4817d
...@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np) ...@@ -1345,8 +1345,8 @@ static int __init exynos_iommu_of_setup(struct device_node *np)
exynos_iommu_init(); exynos_iommu_init();
pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root); pdev = of_platform_device_create(np, NULL, platform_bus_type.dev_root);
if (IS_ERR(pdev)) if (!pdev)
return PTR_ERR(pdev); return -ENODEV;
/* /*
* use the first registered sysmmu device for performing * use the first registered sysmmu device for performing
......
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