mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Tejun Heo <tj@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Arjan van de Ven <arjan@linux.intel.com>,
	Dan Williams <djbw@fb.com>, <linux-kernel@vger.kernel.org>,
	James Hogan <james.hogan@imgtec.com>
Subject: [PATCH 1/1] async: initialise list heads to fix crash
Date: Fri, 25 Jan 2013 10:13:59 +0000	[thread overview]
Message-ID: <1359108839-19232-1-git-send-email-james.hogan@imgtec.com> (raw)
In-Reply-To: <20130125010112.GF2373@mtj.dyndns.org>

The commit "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>
---
 kernel/async.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/async.c b/kernel/async.c
index 6958000..8ddee2c 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
 		ptr(data, newcookie);
 		return newcookie;
 	}
+	INIT_LIST_HEAD(&entry->domain_list);
+	INIT_LIST_HEAD(&entry->global_list);
 	INIT_WORK(&entry->work, async_run_entry_fn);
 	entry->func = ptr;
 	entry->data = data;
-- 
1.7.7.6



  parent reply	other threads:[~2013-01-25 10:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19  0:39 [PATCHSET] async: reimplement synchronization Tejun Heo
2013-01-19  0:39 ` [PATCH 1/4] async: bring sanity to the use of words domain and running Tejun Heo
2013-01-19  0:40 ` [PATCH 2/4] async: use ULLONG_MAX for infinity cookie value Tejun Heo
2013-01-19  0:40 ` [PATCH 3/4] async: keep pending tasks on async_domain and remove async_pending Tejun Heo
2013-01-19  0:41 ` [PATCH 4/4] async: replace list of active domains with global list of pending items Tejun Heo
2013-01-25  0:13   ` James Hogan
2013-01-25  1:01     ` Tejun Heo
2013-01-25 10:08       ` James Hogan
2013-01-25 10:10         ` James Hogan
2013-01-25 10:13       ` James Hogan [this message]
2013-01-25 17:17         ` [PATCH 1/1] async: initialise list heads to fix crash Tejun Heo
2013-01-23 17:33 ` [PATCHSET] async: reimplement synchronization Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359108839-19232-1-git-send-email-james.hogan@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=arjan@linux.intel.com \
    --cc=djbw@fb.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®