diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2016-01-07 07:46:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-01-07 20:03:43 -0500 |
commit | ed6dc538e5a36a331b6256d54f435c80f6715460 (patch) | |
tree | 00da8479bf04907e2d3639aa5ac3faac5e35fd78 | |
parent | e0a7f1f04cd9bb13df7503ba7156ff0a37c9f460 (diff) |
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: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/misc/mei/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index b2f2486b3d75..677d0362f334 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c | |||
@@ -657,7 +657,9 @@ out: | |||
657 | * @file: pointer to file structure | 657 | * @file: pointer to file structure |
658 | * @band: band bitmap | 658 | * @band: band bitmap |
659 | * | 659 | * |
660 | * Return: poll mask | 660 | * Return: negative on error, |
661 | * 0 if it did no changes, | ||
662 | * and positive a process was added or deleted | ||
661 | */ | 663 | */ |
662 | static int mei_fasync(int fd, struct file *file, int band) | 664 | static int mei_fasync(int fd, struct file *file, int band) |
663 | { | 665 | { |
@@ -665,7 +667,7 @@ static int mei_fasync(int fd, struct file *file, int band) | |||
665 | struct mei_cl *cl = file->private_data; | 667 | struct mei_cl *cl = file->private_data; |
666 | 668 | ||
667 | if (!mei_cl_is_connected(cl)) | 669 | if (!mei_cl_is_connected(cl)) |
668 | return POLLERR; | 670 | return -ENODEV; |
669 | 671 | ||
670 | return fasync_helper(fd, file, band, &cl->ev_async); | 672 | return fasync_helper(fd, file, band, &cl->ev_async); |
671 | } | 673 | } |