Commit 47de87a2 authored by Rabin Vincent's avatar Rabin Vincent Committed by Greg Kroah-Hartman

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: default avatarRabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6f6c4dc0
...@@ -459,7 +459,12 @@ static int logger_release(struct inode *ignored, struct file *file) ...@@ -459,7 +459,12 @@ static int logger_release(struct inode *ignored, struct file *file)
{ {
if (file->f_mode & FMODE_READ) { if (file->f_mode & FMODE_READ) {
struct logger_reader *reader = file->private_data; struct logger_reader *reader = file->private_data;
struct logger_log *log = reader->log;
mutex_lock(&log->mutex);
list_del(&reader->list); list_del(&reader->list);
mutex_unlock(&log->mutex);
kfree(reader); kfree(reader);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment