Commit ed6dc538 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: fix fasync return value on error

fasync should return a negative value on error
and not poll mask POLLERR.

Cc: <stable@vger.kernel.org> # 4.3+
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Reported-by: default avatarAl Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e0a7f1f0
...@@ -657,7 +657,9 @@ static unsigned int mei_poll(struct file *file, poll_table *wait) ...@@ -657,7 +657,9 @@ static unsigned int mei_poll(struct file *file, poll_table *wait)
* @file: pointer to file structure * @file: pointer to file structure
* @band: band bitmap * @band: band bitmap
* *
* Return: poll mask * Return: negative on error,
* 0 if it did no changes,
* and positive a process was added or deleted
*/ */
static int mei_fasync(int fd, struct file *file, int band) static int mei_fasync(int fd, struct file *file, int band)
{ {
...@@ -665,7 +667,7 @@ static int mei_fasync(int fd, struct file *file, int band) ...@@ -665,7 +667,7 @@ static int mei_fasync(int fd, struct file *file, int band)
struct mei_cl *cl = file->private_data; struct mei_cl *cl = file->private_data;
if (!mei_cl_is_connected(cl)) if (!mei_cl_is_connected(cl))
return POLLERR; return -ENODEV;
return fasync_helper(fd, file, band, &cl->ev_async); return fasync_helper(fd, file, band, &cl->ev_async);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment