ARM: cpuidle: Fix error return code
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Thu, 11 Aug 2016 13:02:30 +0000 (15:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 15:36:15 +0000 (17:36 +0200)
commit5769cba883d655555e951fa5b7321e7604b78384
tree445badbef6bfa3d1d4b549c22976b3184ce0b9f1
parent847547dd82519ac38c632f035f0420a7948319da
ARM: cpuidle: Fix error return code

commit af48d7bc3756a0cd882d65bff14ab39746ba57fe upstream.

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>
Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpuidle/cpuidle-arm.c