Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp165154pxx; Wed, 28 Oct 2020 01:18:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysLoOw+tdptd8IeSw+tHnmps3n8M8VeSd/NAC4EzVRPaaAeFgtCs4wsO/i1kyW++MLayO4 X-Received: by 2002:a17:906:fcae:: with SMTP id qw14mr6684652ejb.537.1603873081412; Wed, 28 Oct 2020 01:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603873081; cv=none; d=google.com; s=arc-20160816; b=mz3Hep+e/xAGiOdcLaOICQ4866d+IYS1/8bra9VP1pEPb3zNcZhJhwoqmVVO1nlwVF wXN2+Ar/p/b3wobGfJZ7eASJ4ypekEZs7GqZnjf3DC4SufM+z0e0b5nIM2LTpigwQFVT u6X11GdlaQlEandDkWsrUbUKOYjAYkzFKzZHohngN7S/OqTKju/FUTK7SgJ1GQIlowpy AMm6f6Ynz3i4aPUBoWxHxVPpHdvQ90GQYq2/kOBiCMYldiGSjMykVWXkW/KRpcBGBBbR 3q6nfdZ5+bLjxXWiGDVMJu6ynCJk6CIY0eefMTBtW4vH8OCiYlOiCZZTAImLek/Jb63k u6bg== 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=XxEBill/bWyu4nCgJdcnm+LLwdD8XHg/2yBfDSZwoUE=; b=MOKAZenKFFgTohYiMQK0Y3VD6isDR9L6518jwoV7zBdC9KNwgVPiJ97Gh0LTFY5dSB YBgvW2tR8bbWonFcyuhnmOgfNefoLDnhFo5nija3/gW/R+KkCZ10Fn7InS3+Q47Q2Uio 30OdVERTulrQL0aYobSG3DGLdrtOLv8SlqLy4WMp5+ajXROw4s3Fm3dKF17vDB3lcYj/ IKEgL6hNtTgIknC9XMP4SNPsKlaUfFSWeF2hH8FLBkSCMcqlyMQaVBJ+Uwlu0wZLwT1I mU2hFWDwe+d5TLEzmy96tO/BvPGR7SR12kRgMX7eFYqfuLNZZ/HWGGcqawIPBeMxDQFO Juyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ueWyuBQ+; 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 d2si2953320edn.245.2020.10.28.01.17.38; Wed, 28 Oct 2020 01:18:01 -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=ueWyuBQ+; 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 S1753695AbgJ0OBb (ORCPT + 99 others); Tue, 27 Oct 2020 10:01:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:48286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2504367AbgJ0OAp (ORCPT ); Tue, 27 Oct 2020 10:00:45 -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 60AC32068D; Tue, 27 Oct 2020 14:00:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807244; bh=fYOSCIP8zxkfuMuUrdpVgvK1kacTalWOaZtAxrp7EUQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ueWyuBQ+G1o6eIs/4aewxYcIxyY2nhX2Ypx4rloBSSGeausysfstWnLTnFKJIVitm hUi1nYKdazVT5BlgE2pqXLqS76HyYN+UhCEeOmeayJ7v0+f+EjA7+xvjXVMwxcZtvT u3+r6KMumil7EBETjoaB46T5Z4WCIb6F13jpPyJM= 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 4.4 065/112] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier Date: Tue, 27 Oct 2020 14:49:35 +0100 Message-Id: <20201027134903.642260635@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 57e6c45724e73..1930a1d1a1892 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -410,12 +410,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