Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755609AbcJNMaw (ORCPT ); Fri, 14 Oct 2016 08:30:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41059 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755787AbcJNM3D (ORCPT ); Fri, 14 Oct 2016 08:29:03 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Jaillet , Lorenzo Pieralisi , "Rafael J. Wysocki" Subject: [PATCH 4.8 33/37] ARM: cpuidle: Fix error return code Date: Fri, 14 Oct 2016 14:27:19 +0200 Message-Id: <20161014122554.594371970@linuxfoundation.org> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161014122549.411962735@linuxfoundation.org> References: <20161014122549.411962735@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1071 Lines: 33 4.8-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Jaillet 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 Acked-by: Lorenzo Pieralisi Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- 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;