aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2012-02-22 15:58:00 +0530
committerTodd Poynor <toddpoynor@google.com>2013-01-16 13:36:46 -0800
commit1bbba88f7775c1d3ce20f5cfefb9e3ed09c24d4b (patch)
treef2ba5b0a05485e1fc54f857e90c6f08bf1bd8d6f /drivers/staging
parentfbad46f30d0ccb24fcadf4fa129d917fd0bfa1fe (diff)
downloadkernel_samsung_tuna-1bbba88f7775c1d3ce20f5cfefb9e3ed09c24d4b.zip
kernel_samsung_tuna-1bbba88f7775c1d3ce20f5cfefb9e3ed09c24d4b.tar.gz
kernel_samsung_tuna-1bbba88f7775c1d3ce20f5cfefb9e3ed09c24d4b.tar.bz2
staging: logger: hold mutex while removing reader
The readers list is traversed under the log->mutex lock (for example from fix_up_readers()), but the deletion of elements from this list is not being done under this lock. Cc: Brian Swetland <swetland@google.com> Cc: Dima Zavin <dima@android.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/android/logger.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
index 3e09d57..6493728 100644
--- a/drivers/staging/android/logger.c
+++ b/drivers/staging/android/logger.c
@@ -532,7 +532,12 @@ static int logger_release(struct inode *ignored, struct file *file)
{
if (file->f_mode & FMODE_READ) {
struct logger_reader *reader = file->private_data;
+ struct logger_log *log = reader->log;
+
+ mutex_lock(&log->mutex);
list_del(&reader->list);
+ mutex_unlock(&log->mutex);
+
kfree(reader);
}