提交 7c95149b 编写于 作者: R Rafael J. Wysocki

PM / Sleep: Initialize wakeup source locks in wakeup_source_add()

Initialize wakeup source locks in wakeup_source_add() instead of
wakeup_source_create(), because otherwise the locks of the wakeup
sources that haven't been allocated with wakeup_source_create()
aren't initialized and handled properly.
Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
上级 a556d5b5
......@@ -64,7 +64,6 @@ struct wakeup_source *wakeup_source_create(const char *name)
if (!ws)
return NULL;
spin_lock_init(&ws->lock);
if (name)
ws->name = kstrdup(name, GFP_KERNEL);
......@@ -105,6 +104,7 @@ void wakeup_source_add(struct wakeup_source *ws)
if (WARN_ON(!ws))
return;
spin_lock_init(&ws->lock);
setup_timer(&ws->timer, pm_wakeup_timer_fn, (unsigned long)ws);
ws->active = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册