* [PATCH] ARM: cpuidle: Fix error return code
@ 2016-08-11 13:02 Christophe JAILLET
2016-08-11 13:39 ` Lorenzo Pieralisi
2016-08-17 14:16 ` Daniel Lezcano
0 siblings, 2 replies; 5+ messages in thread
From: Christophe JAILLET @ 2016-08-11 13:02 UTC (permalink / raw)
To: rjw, daniel.lezcano
Cc: linux-pm, linux-kernel, kernel-janitors, Christophe JAILLET
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: cpuidle: Fix error return code
2016-08-11 13:02 [PATCH] ARM: cpuidle: Fix error return code Christophe JAILLET
@ 2016-08-11 13:39 ` Lorenzo Pieralisi
2016-08-17 14:16 ` Daniel Lezcano
1 sibling, 0 replies; 5+ messages in thread
From: Lorenzo Pieralisi @ 2016-08-11 13:39 UTC (permalink / raw)
To: Christophe JAILLET
Cc: rjw, daniel.lezcano, linux-pm, linux-kernel, kernel-janitors
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>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: cpuidle: Fix error return code
2016-08-11 13:02 [PATCH] ARM: cpuidle: Fix error return code Christophe JAILLET
2016-08-11 13:39 ` Lorenzo Pieralisi
@ 2016-08-17 14:16 ` Daniel Lezcano
2016-08-18 1:13 ` Rafael J. Wysocki
1 sibling, 1 reply; 5+ messages in thread
From: Daniel Lezcano @ 2016-08-17 14:16 UTC (permalink / raw)
To: Christophe JAILLET, rjw; +Cc: linux-pm, linux-kernel, kernel-janitors
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: cpuidle: Fix error return code
2016-08-17 14:16 ` Daniel Lezcano
@ 2016-08-18 1:13 ` Rafael J. Wysocki
2016-08-18 7:55 ` Daniel Lezcano
0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2016-08-18 1:13 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Christophe JAILLET, linux-pm, linux-kernel, kernel-janitors
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ARM: cpuidle: Fix error return code
2016-08-18 1:13 ` Rafael J. Wysocki
@ 2016-08-18 7:55 ` Daniel Lezcano
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Lezcano @ 2016-08-18 7:55 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Christophe JAILLET, linux-pm, linux-kernel, kernel-janitors
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-08-18 7:55 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-11 13:02 [PATCH] ARM: cpuidle: Fix error return code Christophe JAILLET
2016-08-11 13:39 ` Lorenzo Pieralisi
2016-08-17 14:16 ` Daniel Lezcano
2016-08-18 1:13 ` Rafael J. Wysocki
2016-08-18 7:55 ` Daniel Lezcano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).