diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2012-02-22 15:58:00 +0530 |
---|---|---|
committer | Karol Lewandowski <k.lewandowsk@samsung.com> | 2021-04-22 10:32:05 +0200 |
commit | 2c04b2506818b87d41cfe9f361bf2d2ba201c53f (patch) | |
tree | d066d67ad49605e7e27add7ff00f5c66f81ceb2b | |
parent | 9511f9c7cd45eecbf46537be6ae244306f16bc1d (diff) | |
download | linux-tizen-modules-2c04b2506818b87d41cfe9f361bf2d2ba201c53f.tar.gz linux-tizen-modules-2c04b2506818b87d41cfe9f361bf2d2ba201c53f.tar.bz2 linux-tizen-modules-2c04b2506818b87d41cfe9f361bf2d2ba201c53f.zip |
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>
-rw-r--r-- | drivers/staging/android/logger.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c index 0d2367f..ea69b6a 100644 --- a/drivers/staging/android/logger.c +++ b/drivers/staging/android/logger.c @@ -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); } |