mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-22 17:33:01 +00:00
PM / devfreq: Add proper locking around list_del()
Use devfreq_list_lock around list_del() to prevent list corruption. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
3b91f4b361
commit
0f376c9cd8
@ -594,17 +594,19 @@ struct devfreq *devfreq_add_device(struct device *dev,
|
||||
if (devfreq->governor)
|
||||
err = devfreq->governor->event_handler(devfreq,
|
||||
DEVFREQ_GOV_START, NULL);
|
||||
mutex_unlock(&devfreq_list_lock);
|
||||
if (err) {
|
||||
dev_err(dev, "%s: Unable to start governor for the device\n",
|
||||
__func__);
|
||||
goto err_init;
|
||||
}
|
||||
mutex_unlock(&devfreq_list_lock);
|
||||
|
||||
return devfreq;
|
||||
|
||||
err_init:
|
||||
list_del(&devfreq->node);
|
||||
mutex_unlock(&devfreq_list_lock);
|
||||
|
||||
device_unregister(&devfreq->dev);
|
||||
err_out:
|
||||
return ERR_PTR(err);
|
||||
|
Loading…
Reference in New Issue
Block a user