Re: [PATCH 08/10] cpufreq: Fix broken usage of governor->owner's refcount

From: Rafael J. Wysocki
Date: Sat Aug 03 2013 - 17:56:52 EST


On Saturday, August 03, 2013 06:57:11 PM Viresh Kumar wrote:
> On 3 August 2013 17:38, Rafael J. Wysocki <rjw@xxxxxxx> wrote:
> > On Saturday, August 03, 2013 05:19:26 PM Viresh Kumar wrote:
> >> Governor's owner refcount usage was broken. We should increment refcount only
> >> when CPUFREQ_GOV_POLICY_INIT event has come and should decrement only if
> >> CPUFREQ_GOV_POLICY_EXIT has come.
> >>
> >> Lets fix it.
> >
> > OK, and what happens if we don't fix it?
>
> What about this changelog:
>
> Subject: [PATCH 08/10] cpufreq: Fix broken usage of governor->owner's
> refcount
>
> Governor's owner refcount usage was broken. We should increment refcount only
> when CPUFREQ_GOV_POLICY_INIT event has come and should decrement only if
> CPUFREQ_GOV_POLICY_EXIT has come.
>
> Currently there can be situations where governor is in use but we have allowed
> it to be unloaded. And that may cause in undefined behavior.

"it to be unloaded which may result in undefined behavior."

>
> Lets fix it.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>

Apart from the above looks good.

Thanks,
Rafael


--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/