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


Groups > linux.kernel > #1460500 > unrolled thread

[PATCH] ARM: cpuidle: Fix error return code

Started byChristophe JAILLET <christophe.jaillet@wanadoo.fr>
First post2016-08-11 15:10 +0200
Last post2016-08-18 10:00 +0200
Articles 5 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ARM: cpuidle: Fix error return code Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2016-08-11 15:10 +0200
    Re: [PATCH] ARM: cpuidle: Fix error return code Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> - 2016-08-11 15:40 +0200
    Re: [PATCH] ARM: cpuidle: Fix error return code Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-08-17 16:20 +0200
      Re: [PATCH] ARM: cpuidle: Fix error return code "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-08-18 03:10 +0200
        Re: [PATCH] ARM: cpuidle: Fix error return code Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-08-18 10:00 +0200

#1460500 — [PATCH] ARM: cpuidle: Fix error return code

FromChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Date2016-08-11 15:10 +0200
Subject[PATCH] ARM: cpuidle: Fix error return code
Message-ID<s4XUd-4eY-11@gated-at.bofh.it>
We know that 'ret = 0' because it has been tested a few lines above.
So, if 'kzalloc' fails, 0 will be returned instead of an error code.
Return -ENOMEM instead.

Fixes: a0d46a3dfdc3 ("ARM: cpuidle: Register per cpuidle device")

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/cpuidle/cpuidle-arm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c
index 4ba3d3fe142f..f440d385ed34 100644
--- a/drivers/cpuidle/cpuidle-arm.c
+++ b/drivers/cpuidle/cpuidle-arm.c
@@ -121,6 +121,7 @@ static int __init arm_idle_init(void)
 		dev = kzalloc(sizeof(*dev), GFP_KERNEL);
 		if (!dev) {
 			pr_err("Failed to allocate cpuidle device\n");
+			ret = -ENOMEM;
 			goto out_fail;
 		}
 		dev->cpu = cpu;
-- 
2.7.4


---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus

[toc] | [next] | [standalone]


#1460528

FromLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Date2016-08-11 15:40 +0200
Message-ID<s4Ynf-4pW-19@gated-at.bofh.it>
In reply to#1460500
On Thu, Aug 11, 2016 at 03:02:30PM +0200, Christophe JAILLET wrote:
> We know that 'ret = 0' because it has been tested a few lines above.
> So, if 'kzalloc' fails, 0 will be returned instead of an error code.
> Return -ENOMEM instead.
> 
> Fixes: a0d46a3dfdc3 ("ARM: cpuidle: Register per cpuidle device")
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/cpuidle/cpuidle-arm.c | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

[toc] | [prev] | [next] | [standalone]


#1464602

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2016-08-17 16:20 +0200
Message-ID<s79Rf-29m-13@gated-at.bofh.it>
In reply to#1460500
On 08/11/2016 03:02 PM, Christophe JAILLET wrote:
> We know that 'ret = 0' because it has been tested a few lines above.
> So, if 'kzalloc' fails, 0 will be returned instead of an error code.
> Return -ENOMEM instead.
> 
> Fixes: a0d46a3dfdc3 ("ARM: cpuidle: Register per cpuidle device")
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied, thanks !

  -- Daniel


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

[toc] | [prev] | [next] | [standalone]


#1464876

From"Rafael J. Wysocki" <rjw@rjwysocki.net>
Date2016-08-18 03:10 +0200
Message-ID<s7k0h-PY-7@gated-at.bofh.it>
In reply to#1464602
On Wednesday, August 17, 2016 04:16:09 PM Daniel Lezcano wrote:
> On 08/11/2016 03:02 PM, Christophe JAILLET wrote:
> > We know that 'ret = 0' because it has been tested a few lines above.
> > So, if 'kzalloc' fails, 0 will be returned instead of an error code.
> > Return -ENOMEM instead.
> > 
> > Fixes: a0d46a3dfdc3 ("ARM: cpuidle: Register per cpuidle device")
> > 
> > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> 
> Applied, thanks !

Daniel, I've applied it too and earlier.

Thanks,
Rafael

[toc] | [prev] | [next] | [standalone]


#1464985

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2016-08-18 10:00 +0200
Message-ID<s7qp4-59m-5@gated-at.bofh.it>
In reply to#1464876
On 08/18/2016 03:13 AM, Rafael J. Wysocki wrote:
> On Wednesday, August 17, 2016 04:16:09 PM Daniel Lezcano wrote:
>> On 08/11/2016 03:02 PM, Christophe JAILLET wrote:
>>> We know that 'ret = 0' because it has been tested a few lines above.
>>> So, if 'kzalloc' fails, 0 will be returned instead of an error code.
>>> Return -ENOMEM instead.
>>>
>>> Fixes: a0d46a3dfdc3 ("ARM: cpuidle: Register per cpuidle device")
>>>
>>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>>
>> Applied, thanks !
> 
> Daniel, I've applied it too and earlier.

Ok, thanks for the head up.

  -- Daniel


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web