Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5769cba8 authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Greg Kroah-Hartman
Browse files

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: a0d46a3d ("ARM: cpuidle: Register per cpuidle device")
Signed-off-by: default avatarChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Acked-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 847547dd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -135,6 +135,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;