diff options
author | James Hogan <james.hogan@imgtec.com> | 2013-01-25 05:13:59 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-01-25 12:14:48 -0500 |
commit | a0327ff0eda915be623658babacef706099c11a8 (patch) | |
tree | 4787aedc2877b41e1df066f510b828574527163c /kernel/async.c | |
parent | 9fdb04cdc5566d6ba68283a0bebe49667ca0b0e8 (diff) |
async: initialise list heads to fix crash
9fdb04cdc55 ("async: replace list of active domains with global list
of pending items") added a struct list_head global_list in struct
async_entry, which isn't initialised. This means that if
!domain->registered at __async_schedule(), then list_del_init() will
be called on the list head in async_run_entry_fn with both pointers
NULL, causing a crash. This is fixed by initialising both the
global_list and domain_list list_heads after kzalloc'ing the entry.
This was noticed due to dapm_power_widgets() which uses
ASYNC_DOMAIN_EXCLUSIVE, which initialises the domain->registered to 0.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: James Hogan <james.hogan@imgtec.com>
Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Diffstat (limited to 'kernel/async.c')
-rw-r--r-- | kernel/async.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/async.c b/kernel/async.c index 6958000eeb44..8ddee2c3e5b0 100644 --- a/kernel/async.c +++ b/kernel/async.c | |||
@@ -172,6 +172,8 @@ static async_cookie_t __async_schedule(async_func_ptr *ptr, void *data, struct a | |||
172 | ptr(data, newcookie); | 172 | ptr(data, newcookie); |
173 | return newcookie; | 173 | return newcookie; |
174 | } | 174 | } |
175 | INIT_LIST_HEAD(&entry->domain_list); | ||
176 | INIT_LIST_HEAD(&entry->global_list); | ||
175 | INIT_WORK(&entry->work, async_run_entry_fn); | 177 | INIT_WORK(&entry->work, async_run_entry_fn); |
176 | entry->func = ptr; | 178 | entry->func = ptr; |
177 | entry->data = data; | 179 | entry->data = data; |