Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp174010pxx; Wed, 28 Oct 2020 01:35:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQIPjgcBbGLin5gDZy9axS0Ip4sXfHoDV4uPKW4a2CJofMd+RfP13DxJryQ5xLOhn/L8bZ X-Received: by 2002:a50:e79d:: with SMTP id b29mr6585302edn.57.1603874158664; Wed, 28 Oct 2020 01:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603874158; cv=none; d=google.com; s=arc-20160816; b=g4erv8TcJPmwwCWc3qR0OPDz86q0ZeXwAhvxi9ZBfoBWhifW6yzQlDkny5HN7JiaBr l6PFEAkisyuibMdxAWk4RfGhR/OpWaBVUXHB66AytHONpj81sxVJAXNggcsE++NzEXLG st0D0ocoSY2ZvHTOQqw9nDH6a9SosVOeaHHgvfj0mCpJy1SW2dY4MnOPXFuPBpESIlZO mSQvzE4bR/N6wL3uIETQjdGVW4B96gsXpw+6eN0RuGnBAzB9EDHhJAB+IYYYY6Mxdktb XqluQVufRGlospxEYoNtzzb7DxdUEQIfNZ//n7x4NpbFjaeKqjgPTpttZ7/FXR80zR5F e9VA== 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=CqL1MoA8AhFesyhnYUYwWLOZk0ZqY5Sprc35g+s8CF8=; b=jlGRyO9gyDg0UlsEivTd9jVEcK6IZCnZHEHFgpYLdDMwd3WPOVnKfw0azOdP89PkQF ZkzBARNvzWXj77WubU926xMMc/DN9K6esgXhVbKXSvDkiVGDKIkPvtFURByXJIH/78es keXIePwfflkM8t930hOWWbPZrN4yaeMhFOKO7xvEHA7mQe31mU1+0JWjTqOv6OurZMLk ZTJ7ruXSUII+R/a0DRSR6ete+QZ4d6VI0tjILUE7WEV9BDxKdSrn3GhaZKj1RUwy2PiF 8Vxw1KpiErO3hLzZXi64NIvoC9Q1xl913jvugSsX0jCKIpRZ/oyYejJDhqXP4rowYKfi YqQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l+LEILpl; 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 bt10si1135660edb.503.2020.10.28.01.35.36; Wed, 28 Oct 2020 01:35:58 -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=l+LEILpl; 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 S1754651AbgJ0OGW (ORCPT + 99 others); Tue, 27 Oct 2020 10:06:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:54688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754630AbgJ0OGS (ORCPT ); Tue, 27 Oct 2020 10:06:18 -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 94FA02222C; Tue, 27 Oct 2020 14:06:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807578; bh=b0JL592XtodxR/lOgCIRkaiui56MwYALwPlAaRY8YZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l+LEILplbxVymdv/t6eChXv4V9ehih/pL4nRJkUcVVS438hXuddstT0S0qzhyNLWi cwhhW1YxMTmTYpNejk+5MQmuUS5TihJisfc9aCsM/GTIwpGKWIlSZrbc+X6viEGfZA hGHBE+ojLEDn1VYMHE9/aCSLKF+k1dYKLKD1mUsc= 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.9 073/139] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier Date: Tue, 27 Oct 2020 14:49:27 +0100 Message-Id: <20201027134905.586882610@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@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 c3b05676e0dbe..8d18264794252 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -784,12 +784,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