summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/mei/bus.c3
-rw-r--r--drivers/misc/mei/main.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 1f33fea9299f..63411ddfb83d 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -126,7 +126,8 @@ ssize_t __mei_cl_recv(struct mei_cl *cl, u8 *buf, size_t length)
126 goto out; 126 goto out;
127 127
128 /* wait on event only if there is no other waiter */ 128 /* wait on event only if there is no other waiter */
129 if (list_empty(&cl->rd_completed) && !waitqueue_active(&cl->rx_wait)) { 129 /* synchronized under device mutex */
130 if (!waitqueue_active(&cl->rx_wait)) {
130 131
131 mutex_unlock(&bus->device_lock); 132 mutex_unlock(&bus->device_lock);
132 133
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index a8d0471f817f..3326bde7fba1 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -183,7 +183,8 @@ static ssize_t mei_read(struct file *file, char __user *ubuf,
183 goto out; 183 goto out;
184 } 184 }
185 185
186 if (list_empty(&cl->rd_completed) && !waitqueue_active(&cl->rx_wait)) { 186 /* synchronized under device mutex */
187 if (!waitqueue_active(&cl->rx_wait)) {
187 if (file->f_flags & O_NONBLOCK) { 188 if (file->f_flags & O_NONBLOCK) {
188 rets = -EAGAIN; 189 rets = -EAGAIN;
189 goto out; 190 goto out;