Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565303 > unrolled thread

[PATCH] ACPI/IORT: Fix error handling

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2017-01-23 22:00 +0100
Last post2017-01-24 02:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ACPI/IORT: Fix error handling Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-01-23 22:00 +0100
    Re: [PATCH] ACPI/IORT: Fix error handling Hanjun Guo <hanjun.guo@linaro.org> - 2017-01-24 02:30 +0100

#1565303 — [PATCH] ACPI/IORT: Fix error handling

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2017-01-23 22:00 +0100
Subject[PATCH] ACPI/IORT: Fix error handling
Message-ID<t2TSy-2N8-19@gated-at.bofh.it>
If 'platform_device_alloc()' returns NULL, the current code returns
0, which means success. Return -ENOMEM instead.

Fixes: 846f0e9e74a0 ("ACPI/IORT: Add support for ARM SMMU platform devices creation")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/acpi/arm64/iort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index e0d2e6e6e40c..655407ad112e 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);
 
-- 
2.9.3

[toc] | [next] | [standalone]


#1565400

FromHanjun Guo <hanjun.guo@linaro.org>
Date2017-01-24 02:30 +0100
Message-ID<t2Y5P-5Vh-3@gated-at.bofh.it>
In reply to#1565303
Hi Christophe,

On 2017/1/24 4:50, Christophe JAILLET wrote:
> If 'platform_device_alloc()' returns NULL, the current code returns
> 0, which means success. Return -ENOMEM instead.
>
> Fixes: 846f0e9e74a0 ("ACPI/IORT: Add support for ARM SMMU platform devices creation")
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/acpi/arm64/iort.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
> index e0d2e6e6e40c..655407ad112e 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);

Thanks for the fix, but Dan beats you to this fix [1] :)

[1]: http://www.spinics.net/lists/linux-acpi/msg71383.html

Thanks
Hanjun

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web