diff options
author | Tim Bird <tim.bird@am.sony.com> | 2012-02-07 18:30:09 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-08 16:52:44 -0800 |
commit | c76c7ca31f16c9556cad527bfa3504b0aafb3045 (patch) | |
tree | d384a290b028b84a82ee458ab8521788913eedb9 | |
parent | 3bcfa431334d99fa8bff96c4e7c2108f0b26242e (diff) | |
download | op-kernel-dev-c76c7ca31f16c9556cad527bfa3504b0aafb3045.zip op-kernel-dev-c76c7ca31f16c9556cad527bfa3504b0aafb3045.tar.gz |
staging: android: logger: reorder prepare_to_wait and mutex_lock
If mutex_lock waits, it will return in state TASK_RUNNING,
rubbing out the effect of prepare_to_wait().
Signed-off-by: Tim Bird <tim.bird@am.sony.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/android/logger.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c index 1e9e638..6dd6f04 100644 --- a/drivers/staging/android/logger.c +++ b/drivers/staging/android/logger.c @@ -172,9 +172,10 @@ static ssize_t logger_read(struct file *file, char __user *buf, start: while (1) { + mutex_lock(&log->mutex); + prepare_to_wait(&log->wq, &wait, TASK_INTERRUPTIBLE); - mutex_lock(&log->mutex); ret = (log->w_off == reader->r_off); mutex_unlock(&log->mutex); if (!ret) |