mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-07 09:09:23 +00:00
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>
This commit is contained in:
parent
29b4817d40
commit
423595e89d
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue