projects
/
kernel
/
kernel-generic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3bcfa43
)
staging: android: logger: reorder prepare_to_wait and mutex_lock
author
Tim Bird
<tim.bird@am.sony.com>
Wed, 8 Feb 2012 02:30:09 +0000
(18:30 -0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 9 Feb 2012 00:52:44 +0000
(16:52 -0800)
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>
drivers/staging/android/logger.c
patch
|
blob
|
history
diff --git
a/drivers/staging/android/logger.c
b/drivers/staging/android/logger.c
index
1e9e638
..
6dd6f04
100644
(file)
--- 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)