aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/misc/mei/main.c
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2016-06-16 17:58:54 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-30 14:36:39 +0200
commit1eb5bd4d83f566e5ea8521b6020d0cfcb8f1c3ef (patch)
tree9b64729dc95627aebdd85fac2a0697d10e435a08 /drivers/misc/mei/main.c
parentmei: hbm: add missing argument in the kdoc (diff)
downloadwireguard-linux-1eb5bd4d83f566e5ea8521b6020d0cfcb8f1c3ef.tar.xz
wireguard-linux-1eb5bd4d83f566e5ea8521b6020d0cfcb8f1c3ef.zip
mei: drop read complete queue emptiness check
In the course of the read flow we want to wait for read completion only if the read queue is empty. However the calling list_empty(&cl->rd_completed) is a duplication as the same check was performed by mei_cl_read_cb() and the waiting is skipped if it returns not NULL. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r--drivers/misc/mei/main.c3
1 files changed, 2 insertions, 1 deletions
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,
goto out;
}
- if (list_empty(&cl->rd_completed) && !waitqueue_active(&cl->rx_wait)) {
+ /* synchronized under device mutex */
+ if (!waitqueue_active(&cl->rx_wait)) {
if (file->f_flags & O_NONBLOCK) {
rets = -EAGAIN;
goto out;