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>
This commit is contained in:
parent
6f6c4dc040
commit
47de87a234
|
@ -459,7 +459,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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue