Skip to content

Commit

Permalink
PM / OPP replace kfree_rcu() with call_srcu() in opp_set_availability()
Browse files Browse the repository at this point in the history
This existed before we introduced call_srcu() in opp layer to synchronize with
srcu_notifier_call_chain() while removing OPPs. And is a potential bug which
wasn't noticed earlier.

Let fix it as well by using the right API to free OPP.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Nov 29, 2014
1 parent 129eec5 commit b4037aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/power/opp.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ static int opp_set_availability(struct device *dev, unsigned long freq,

list_replace_rcu(&opp->node, &new_opp->node);
mutex_unlock(&dev_opp_list_lock);
kfree_rcu(opp, rcu_head);
call_srcu(&dev_opp->srcu_head.srcu, &opp->rcu_head, kfree_opp_rcu);

/* Notify the change of the OPP availability */
if (availability_req)
Expand Down

0 comments on commit b4037aa

Please sign in to comment.