From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacob Shin Subject: Re: od_set_powersave_bias: NULL pointer dereference Date: Wed, 26 Jun 2013 09:35:55 -0500 Message-ID: <20130626143555.GA2989@jshin-Toonie> References: <51C87ADC.4070409@canonical.com> <20130625161935.GA10208@jshin-Toonie> <20130626142852.GA2326@jshin-Toonie> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: Sender: cpufreq-owner@vger.kernel.org To: Viresh Kumar Cc: Tim Gardner , "Rafael J. Wysocki" , LKML , cpufreq@vger.kernel.org, linux-pm@vger.kernel.org List-Id: linux-pm@vger.kernel.org On Wed, Jun 26, 2013 at 08:02:29PM +0530, Viresh Kumar wrote: > On 26 June 2013 19:58, Jacob Shin wrote: > > On Wed, Jun 26, 2013 at 12:18:27PM +0530, Viresh Kumar wrote: > > >> I am not sure if this is enough. What if we had ondemand as the > >> governor initially, then we changed it to something else. Now also > >> cur_policy contains a address and isn't zero. > > > > Right, so we check below .. > > > >> > >> > cpumask_or(&done, &done, policy->cpus); > >> > + > >> > + if (policy->governor != &cpufreq_gov_ondemand) > >> > + continue; > > > > This should catch that case no ? > > Policy might be freed and reallocated by then. And so doing > policy->governor is dangerous. Hm . any hints on how to check for if ondemand is running on this CPU or not ? I'm not sure what the best way to handle this is .. Thanks,