From patchwork Wed May 31 16:59:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juri Lelli X-Patchwork-Id: 100802 Delivered-To: patch@linaro.org Received: by 10.140.96.100 with SMTP id j91csp418448qge; Wed, 31 May 2017 10:03:06 -0700 (PDT) X-Received: by 10.98.37.68 with SMTP id l65mr32002631pfl.175.1496250186808; Wed, 31 May 2017 10:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496250186; cv=none; d=google.com; s=arc-20160816; b=qVa2HTy8IQ90E0Zrqhq1GJsei3ZkN0X6sXCkWOQr9fkglg9rD4AOPG6m+BeUmjWCRQ G6zyH1OGCGDwoeKta4C0RRZE7oJUI9+7cQnXTbB+HSY3xRa6bMha6ebJ3Gvv5q3gMMNC 3+VjY5gszYJMt6++taQyZ0uNT/tfaGjP3Jly4jVu90m94mK2jc8wgsR+uPdtNddI8FuK zFoS+CyR+N3JffcVdzgR2FhbbpXYcngoqfiH647uGRdmpHcKUKonbqhKFBAcAZyrk8Mh a8S/0vJIsGwOJCklqjsg0DP9MD10BCTo+aDXcbZL8Jb5IxvcSY+JSPS1BYbiye9KzLyZ Px4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=RLdGk/43J4vAr2XIqDzE4TZ7W6WE6cml2cyUNk9TSeE=; b=KQX9FL/s7xaQ0siIRS0q785V6vK3mj7hzFH88x8nJjFUtUdi6hJM8k2u1+o7zNNtWH 9Fbl6CqMrbeKEqH8x7d4SdxLr9vr8wOOgMRoDORmul+M/m9iq+zwCWAQepvuvAJuMsle z4Ugq7UdldncagavN4bSRZHXikbbv6QMv0ncV/DFsxcsyFCG0+ZZjdNmkXRpblW0owup u3bmYiUTRLk3N2Wd6A0Ww460jys3dS0imoFr6c0aqHiT7csgrBcCU4kdkrwP7Vp6EnBj mfPWrPbZRWD9waNBDBpKbGo/FS5d9UX8W06Ljj4X8Wzj80sCTzBDiZklFgel/464KiFH 4p/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s68si17376996pfg.108.2017.05.31.10.03.06; Wed, 31 May 2017 10:03:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751453AbdEaRAm (ORCPT + 25 others); Wed, 31 May 2017 13:00:42 -0400 Received: from foss.arm.com ([217.140.101.70]:46810 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751153AbdEaQ7z (ORCPT ); Wed, 31 May 2017 12:59:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BA7D915B2; Wed, 31 May 2017 09:59:54 -0700 (PDT) Received: from cam-smtp0.cambridge.arm.com (e106622-lin.cambridge.arm.com [10.1.211.43]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id D5B343F589; Wed, 31 May 2017 09:59:51 -0700 (PDT) From: Juri Lelli To: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, linux@arm.linux.org.uk, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, juri.lelli@arm.com, broonie@kernel.org, gregkh@linuxfoundation.org Subject: [PATCH v5 2/7] arm: fix return value of parse_cpu_capacity Date: Wed, 31 May 2017 17:59:26 +0100 Message-Id: <20170531165931.6945-3-juri.lelli@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170531165931.6945-1-juri.lelli@arm.com> References: <20170531165931.6945-1-juri.lelli@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org parse_cpu_capacity() has to return 0 on failure, but it currently returns 1 instead if raw_capacity kcalloc failed. Fix it (by directly returning 0). Cc: Russell King Reported-by: Morten Rasmussen Fixes: 06073ee26775 ('ARM: 8621/3: parse cpu capacity-dmips-mhz from DT') Signed-off-by: Juri Lelli Acked-by: Russell King Acked-by: Vincent Guittot --- arch/arm/kernel/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.11.0 diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index f8a3ab82e77f..1b8ec3054642 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -166,7 +166,7 @@ static int __init parse_cpu_capacity(struct device_node *cpu_node, int cpu) if (!raw_capacity) { pr_err("cpu_capacity: failed to allocate memory for raw capacities\n"); cap_parsing_failed = true; - return !ret; + return 0; } } capacity_scale = max(cpu_capacity, capacity_scale);