Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp230522pxx; Wed, 28 Oct 2020 03:31:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNLs4MYU4VIiSzOIYenSckJXdbZKOsLyPWZURXJq0LSR4x9JI55tDy+3YSwj/81a9VCCGs X-Received: by 2002:a17:906:d0cc:: with SMTP id bq12mr1285762ejb.127.1603881091957; Wed, 28 Oct 2020 03:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603881091; cv=none; d=google.com; s=arc-20160816; b=MgpxNSQ/5Rv2Xe1mkf6GlEIgUQ9ofPhkTJsTE/zqqfpVtJ+NCn8n4YH5WS5KKMZfrA SNiSi19o0jqux7lVZiMHvBTWAgPPugf1ixoK+1Mdg1OuwTEzFNgb/HvvokEPnUg9UaUp MnoA2ED1leakRxCW+p9AwNC3kacC+BppOigvy3780Diit8Fis6mV04Ib/4s/ziautVX/ 3lfg5luyXEsFMalJOwO5Z2+tIDM3u7JZAlXCb/i5b24Cw1DN4rGJakIvvqkvxibqKpWP ORGXfnqEFX3kEDspfJwyLYAPiRtc3ZXrzlOjRORRTdkrRzFq5DbRtNnNlwvgVXEB4gzW gRMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t/0bp2hjEaYD+cSDCQaXePmDiLV02MlynW77sutE0Ms=; b=UpTyW0dZmbtmtHAzBalBzryaASnVK4e3Togxk1gXNlLjxMoHFucx5v6drjx2zqpZ7z 0eO9L/gXKtfGDWwjV7uoMTyuqioCv5mEWd1d+gperBKIcW5fs/j5tbtFrqJ7I75HWw/J CkbTgba0T7UJWaX91pMK1X5EUGgfjXutt52Tw5QPhvIaHzG+ahZEHOE/+QV/wv75dsrm radxZOfaHexbd/Fqmi4mhYcsSd/LyuDt+o/zu8oikwA5f40PLKTvsKig+8fxECw8zpKo wmSuRqc5XB8+64skHWeMBMicWsGegXsNykJ+hFgGerxiVd+DSTQoh270WPAF47NooD6q VHnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AfMXhl8J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg14si2653130ejb.82.2020.10.28.03.31.09; Wed, 28 Oct 2020 03:31:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AfMXhl8J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762410AbgJ0Omk (ORCPT + 99 others); Tue, 27 Oct 2020 10:42:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:39596 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762021AbgJ0Okd (ORCPT ); Tue, 27 Oct 2020 10:40:33 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCE4A206B2; Tue, 27 Oct 2020 14:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809631; bh=Kgjl+nmVTWZScmV+yXhrClIYvCqn0EryO2Gs81rb3yQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AfMXhl8JEvywqTscrA1QY5i2/npJmpYUL/qAcNwirSmvjvQt7PEzBcqqyVY2RXOTk 9lqzSqU/ql9caSJXkGlL8si88l0rdLAPLKYmtKJxYTw08DW38QwU25Mnp7YxeSBiDq ZcbLMPmB+NkX80yrr3mhtMcVPJ6560SjAOwzw738= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srikar Dronamraju , Daniel Axtens , Michael Ellerman , Sasha Levin Subject: [PATCH 5.4 247/408] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier Date: Tue, 27 Oct 2020 14:53:05 +0100 Message-Id: <20201027135506.517458820@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srikar Dronamraju [ Upstream commit a2d0230b91f7e23ceb5d8fb6a9799f30517ec33a ] The patch avoids allocating cpufreq_policy on stack hence fixing frame size overflow in 'powernv_cpufreq_reboot_notifier': drivers/cpufreq/powernv-cpufreq.c: In function powernv_cpufreq_reboot_notifier: drivers/cpufreq/powernv-cpufreq.c:906:1: error: the frame size of 2064 bytes is larger than 2048 bytes Fixes: cf30af76 ("cpufreq: powernv: Set the cpus to nominal frequency during reboot/kexec") Signed-off-by: Srikar Dronamraju Reviewed-by: Daniel Axtens Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20200922080254.41497-1-srikar@linux.vnet.ibm.com Signed-off-by: Sasha Levin --- drivers/cpufreq/powernv-cpufreq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 3a2f022f6bde2..bc6ccf2c7aae0 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -884,12 +884,15 @@ static int powernv_cpufreq_reboot_notifier(struct notifier_block *nb, unsigned long action, void *unused) { int cpu; - struct cpufreq_policy cpu_policy; + struct cpufreq_policy *cpu_policy; rebooting = true; for_each_online_cpu(cpu) { - cpufreq_get_policy(&cpu_policy, cpu); - powernv_cpufreq_target_index(&cpu_policy, get_nominal_index()); + cpu_policy = cpufreq_cpu_get(cpu); + if (!cpu_policy) + continue; + powernv_cpufreq_target_index(cpu_policy, get_nominal_index()); + cpufreq_cpu_put(cpu_policy); } return NOTIFY_DONE; -- 2.25.1