Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753094AbcCKXwm (ORCPT ); Fri, 11 Mar 2016 18:52:42 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:35743 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751698AbcCKXwk (ORCPT ); Fri, 11 Mar 2016 18:52:40 -0500 Date: Sat, 12 Mar 2016 06:52:37 +0700 From: Viresh Kumar To: Richard Cochran Cc: linux-kernel@vger.kernel.org, rt@linutronix.de, Dirk Brandewie , "Rafael J. Wysocki" , linux-pm@vger.kernel.org Subject: Re: [PATCH v2] cpufreq: Make cpufreq_quick_get() safe to call. Message-ID: <20160311235237.GA27500@vireshk-mac-ubuntu> References: <1457685787-6046-1-git-send-email-rcochran@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457685787-6046-1-git-send-email-rcochran@linutronix.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 785 Lines: 21 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 -- viresh