• Viresh Kumar's avatar
    cpufreq: Warn users while freeing active policy · a2f6a7ac
    Viresh Kumar authored
    With the new design in place, the show() and store() callbacks check if
    the policy is active or not before proceeding any further to avoid
    potential races. And in order to guarantee that cpufreq_policy_free()
    must be called after clearing the policy->cpus mask, i.e. by marking the
    policy inactive.
    
    In order to avoid introducing a bug around this later, print a warning
    message if we end up freeing an active policy.
    
    Also update cpufreq_online() a bit to make sure we clear the cpus mask
    for each error case before calling cpufreq_policy_free().
    Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    a2f6a7ac
cpufreq.c 76.7 KB