lkml.org 
[lkml]   [2016]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.8 33/37] ARM: cpuidle: Fix error return code
    Date
    4.8-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Christophe Jaillet <christophe.jaillet@wanadoo.fr>

    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 | 1 +
    1 file changed, 1 insertion(+)

    --- 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;

    \
     
     \ /
      Last update: 2016-10-14 14:31    [W:4.270 / U:0.840 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site