linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / devfreq: Add proper locking around list_del()
@ 2016-09-28  9:17 Axel Lin
  0 siblings, 0 replies; 2+ messages in thread
From: Axel Lin @ 2016-09-28  9:17 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: Chanwoo Choi, MyungJoo Ham, Kyungmin Park, linux-pm,
	linux-samsung-soc, Axel Lin

Use devfreq_list_lock around list_del() to prevent list corruption.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/devfreq/devfreq.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 478006b..70369b0 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -604,7 +604,10 @@ struct devfreq *devfreq_add_device(struct device *dev,
 	return devfreq;
 
 err_init:
+	mutex_lock(&devfreq_list_lock);
 	list_del(&devfreq->node);
+	mutex_unlock(&devfreq_list_lock);
+
 	device_unregister(&devfreq->dev);
 err_out:
 	return ERR_PTR(err);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-29  2:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20160928091837epcas1p2e3a1fbf609e57b789c503ce4c1799dd1@epcas1p2.samsung.com>
2016-09-29  2:02 ` [PATCH] PM / devfreq: Add proper locking around list_del() MyungJoo Ham
2016-09-28  9:17 Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).