Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755672Ab2BVK3a (ORCPT ); Wed, 22 Feb 2012 05:29:30 -0500 Received: from eu1sys200aog113.obsmtp.com ([207.126.144.135]:50910 "EHLO eu1sys200aog113.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750783Ab2BVK33 (ORCPT ); Wed, 22 Feb 2012 05:29:29 -0500 From: Rabin Vincent To: Cc: , Rabin Vincent , Brian Swetland , Dima Zavin Subject: [PATCH] staging: logger: hold mutex while removing reader Date: Wed, 22 Feb 2012 15:58:00 +0530 Message-ID: <1329906480-22752-1-git-send-email-rabin.vincent@stericsson.com> X-Mailer: git-send-email 1.7.4.3 MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1193 Lines: 36 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 Cc: Dima Zavin Signed-off-by: Rabin Vincent --- 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 ffc2d04..a45c3b0 100644 --- a/drivers/staging/android/logger.c +++ b/drivers/staging/android/logger.c @@ -432,7 +432,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); } -- 1.7.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/