]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ACPI/IORT: Fix the error return code in iort_add_smmu_platform_device()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 17 Jan 2017 13:36:23 +0000 (16:36 +0300)
committerWill Deacon <will.deacon@arm.com>
Mon, 6 Feb 2017 18:59:52 +0000 (18:59 +0000)
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>
drivers/acpi/arm64/iort.c

index ba156c5afc16d363fc9291cd186c3687bfb27d10..6d78b467d0ec2ef037f7d0a9fbb69e3c8a9c4669 100644 (file)
@@ -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);