Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753505AbcCRXcs (ORCPT ); Fri, 18 Mar 2016 19:32:48 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:62164 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753108AbcCRXcl (ORCPT ); Fri, 18 Mar 2016 19:32:41 -0400 From: "Rafael J. Wysocki" To: Viresh Kumar , Richard Cochran , "Rafael J. Wysocki" Cc: linux-kernel@vger.kernel.org, rt@linutronix.de, linux-pm@vger.kernel.org Subject: Re: [PATCH v2] cpufreq: Make cpufreq_quick_get() safe to call. Date: Sat, 19 Mar 2016 00:34:46 +0100 Message-ID: <3461345.ttUnIM4Vzr@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.5.0-rc1+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20160311235237.GA27500@vireshk-mac-ubuntu> References: <1457685787-6046-1-git-send-email-rcochran@linutronix.de> <20160311235237.GA27500@vireshk-mac-ubuntu> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit 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: 887 Lines: 21 On Saturday, March 12, 2016 06:52:37 AM Viresh Kumar wrote: > On 11-03-16, 09:43, Richard Cochran wrote: > > The function, cpufreq_quick_get, accesses the global 'cpufreq_driver' and > > its fields without taking the associated lock, cpufreq_driver_lock. > > > > Without the locking, nothing guarantees that 'cpufreq_driver' remains > > consistent during the call. This patch fixes the issue by taking the lock > > before accessing the data structure. > > > > Cc: Dirk Brandewie > > Cc: Rafael J. Wysocki > > Cc: Viresh Kumar > > Cc: linux-pm@vger.kernel.org > > Signed-off-by: Richard Cochran > > --- > > drivers/cpufreq/cpufreq.c | 12 ++++++++++-- > > 1 file changed, 10 insertions(+), 2 deletions(-) > > Acked-by: Viresh Kumar Applied, thanks!