From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754190AbcBGPy6 (ORCPT ); Sun, 7 Feb 2016 10:54:58 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:33599 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753972AbcBGPy4 (ORCPT ); Sun, 7 Feb 2016 10:54:56 -0500 Date: Sun, 7 Feb 2016 21:24:53 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Linux PM list , Linux Kernel Mailing List , Srinivas Pandruvada , Juri Lelli , Steve Muckle , Saravana Kannan Subject: Re: [PATCH 2/3] cpufreq: governor: Rearrange governor data structures Message-ID: <20160207155452.GI3808@vireshk> References: <3705929.bslqXH980s@vostro.rjw.lan> <9008098.QDD8C89zDx@vostro.rjw.lan> <2998470.K7oslgfuja@vostro.rjw.lan> <2710262.Af7Ngczbqf@vostro.rjw.lan> <20160207154556.GG3808@vireshk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160207154556.GG3808@vireshk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07-02-16, 21:15, Viresh Kumar wrote: > On 07-02-16, 16:24, Rafael J. Wysocki wrote: > > static int cpufreq_governor_exit(struct cpufreq_policy *policy) > > { > > struct dbs_governor *gov = dbs_governor_of(policy); > > - struct dbs_data *dbs_data = policy->governor_data; > > - struct cpu_dbs_info *cdbs = gov->get_cpu_cdbs(policy->cpu); > > + struct policy_dbs_info *policy_dbs = policy->governor_data; > > + struct dbs_data *dbs_data = policy_dbs->dbs_data; > > > > /* State should be equivalent to INIT */ > > - if (!cdbs->policy_dbs || cdbs->policy_dbs->policy) > > + if (policy_dbs->policy) > > return -EBUSY; > > We can crash here if policy_dbs is NULL, which can happen if EXIT is called > twice (due to the lock-dropping thing in cpufreq-core). So we really need to > keep these checks for now atleast. Well no, things have changed now a bit with your recent changes and so this wouldn't be an issue here. Sorry for the noise. -- viresh