public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/7] uvesafb: always use mutexes when accessing uvfb_tasks
@ 2007-08-11 14:39 Michal Januszewski
  0 siblings, 0 replies; only message in thread
From: Michal Januszewski @ 2007-08-11 14:39 UTC (permalink / raw)
  To: linux-fbdev-devel; +Cc: linux-kernel

Accesses to the uvfb_tasks array should be always be protected by a
mutex to avoid race conditions.

Signed-off-by: Michal Januszewski <spock@gentoo.org>
---
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index aa5a9c3..e480670 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -208,6 +208,10 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
 		err = !wait_for_completion_timeout(task->done,
 				msecs_to_jiffies(UVESAFB_TIMEOUT));
 
+	mutex_lock(&uvfb_lock);
+	uvfb_tasks[seq] = NULL;
+	mutex_unlock(&uvfb_lock);
+
 	seq++;
 	if (seq >= UVESAFB_TASKS_MAX)
 		seq = 0;



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-08-11 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-11 14:39 [PATCH 2/7] uvesafb: always use mutexes when accessing uvfb_tasks Michal Januszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox