Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932567AbcCBBQm (ORCPT ); Tue, 1 Mar 2016 20:16:42 -0500 Received: from mail177-1.suw61.mandrillapp.com ([198.2.177.1]:43852 "EHLO mail177-1.suw61.mandrillapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755629AbcCAXzj (ORCPT ); Tue, 1 Mar 2016 18:55:39 -0500 From: Greg Kroah-Hartman Subject: [PATCH 4.4 113/342] mei: fix fasync return value on error X-Mailer: git-send-email 2.7.2 To: Cc: Greg Kroah-Hartman , , Al Viro , Tomas Winkler Message-Id: <20160301234531.616052391@linuxfoundation.org> In-Reply-To: <20160301234527.990448862@linuxfoundation.org> References: <20160301234527.990448862@linuxfoundation.org> X-Report-Abuse: Please forward a copy of this message, including all headers, to abuse@mandrill.com X-Report-Abuse: You can also report abuse here: http://mandrillapp.com/contact/abuse?id=30481620.1e16dc24f0254d9f8148ea077762c95b X-Mandrill-User: md_30481620 Date: Tue, 01 Mar 2016 23:54:21 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1172 Lines: 42 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tomas Winkler commit ed6dc538e5a36a331b6256d54f435c80f6715460 upstream. fasync should return a negative value on error and not poll mask POLLERR. Cc: Al Viro Reported-by: Al Viro Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- drivers/misc/mei/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -657,7 +657,9 @@ out: * @file: pointer to file structure * @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) { @@ -665,7 +667,7 @@ static int mei_fasync(int fd, struct fil struct mei_cl *cl = file->private_data; if (!mei_cl_is_connected(cl)) - return POLLERR; + return -ENODEV; return fasync_helper(fd, file, band, &cl->ev_async); }