summaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-01-17 14:36:23 +0100
committerWill Deacon <will.deacon@arm.com>2017-02-06 19:59:52 +0100
commit5e5afa6cbdae5cc2ceda232a68a9ddc943d1d5ce (patch)
treeb8506031daa06c0be542d5362103e3f9783487f5 /drivers/acpi
parentACPI/IORT: Fix iort_node_get_id() mapping entries indexing (diff)
downloadlinux-5e5afa6cbdae5cc2ceda232a68a9ddc943d1d5ce.tar.xz
linux-5e5afa6cbdae5cc2ceda232a68a9ddc943d1d5ce.zip
ACPI/IORT: Fix the error return code in iort_add_smmu_platform_device()
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: 846f0e9e74a0 ("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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/arm64/iort.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index ba156c5afc16..6d78b467d0ec 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -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);