From 3206e09443e604d8aa5d20f75fd39357d0bf03d4 Mon Sep 17 00:00:00 2001 From: Diego Nieto Cid Date: Mon, 15 Nov 2010 04:10:58 -0300 Subject: Properly release console lock. The console lock was released only when there were no allocation errors leaving it locked in the event mmap failed. This patch moves the mutex_unlock call to a point in the flow of control where it is consistent with the lock acquisition. * console/console.c(netfs_get_dirents): Relocate mutex_unlock call to common return path. --- console/console.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/console/console.c b/console/console.c index dad7516e..bac9eb8e 100644 --- a/console/console.c +++ b/console/console.c @@ -862,7 +862,6 @@ netfs_get_dirents (struct iouser *cred, struct node *dir, if (!add_dir_entry (vcons->name, vcons->id << 2, DT_DIR)) break; - mutex_unlock (&dir->nn->cons->lock); } else { @@ -880,7 +879,10 @@ netfs_get_dirents (struct iouser *cred, struct node *dir, add_dir_entry ("input", (dir->nn->vcons->id << 3) + 2, DT_FIFO); } } - + + if (dir->nn->cons) + mutex_unlock(&dir->nn->cons->lock); + fshelp_touch (&dir->nn_stat, TOUCH_ATIME, console_maptime); return err; } -- cgit v1.2.3