]> git.karo-electronics.de Git - linux-beck.git/commit
iommu/exynos: Fix error handling for of_platform_device_create
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Mon, 1 Aug 2016 06:18:38 +0000 (11:48 +0530)
committerJoerg Roedel <jroedel@suse.de>
Tue, 9 Aug 2016 15:27:48 +0000 (17:27 +0200)
commit423595e89ddf9b657812a33932a5e2ad1bb9dd54
tree99623022f61aca32374c0c58a338da06cd17b0c2
parent29b4817d4018df78086157ea3a55c1d9424a7cfc
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>
drivers/iommu/exynos-iommu.c