Skip to content

Commit

Permalink
ACPI/IORT: Fix the error return code in iort_add_smmu_platform_device()
Browse files Browse the repository at this point in the history
The function iort_add_smmu_platform_device() accidentally returns 0
(ie PTR_ERR(pdev) where pdev == NULL) if platform_device_alloc() fails;
fix the bug by returning a proper error value.

Fixes: 846f0e9 ("ACPI/IORT: Add support for ARM SMMU platform devices creation")
Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[lorenzo.pieralisi@arm.com: improved commit log]
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

Signed-off-by: Will Deacon <will.deacon@arm.com>
  • Loading branch information
Dan Carpenter authored and Will Deacon committed Feb 6, 2017
1 parent 030abd8 commit 5e5afa6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/arm64/iort.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ static int __init iort_add_smmu_platform_device(struct acpi_iort_node *node)

pdev = platform_device_alloc(ops->name, PLATFORM_DEVID_AUTO);
if (!pdev)
return PTR_ERR(pdev);
return -ENOMEM;

count = ops->iommu_count_resources(node);

Expand Down

0 comments on commit 5e5afa6

Please sign in to comment.