From patchwork Tue Jan 14 10:02:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 233928 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10F4DC33CB1 for ; Tue, 14 Jan 2020 10:14:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CEE63207FF for ; Tue, 14 Jan 2020 10:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578996887; bh=y3hojQXEA8XV+d/pNvuWwQg0+T/RPwpbZaLgU7memec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Ky84R8sOPBMYmg9yIvqbsjnhl7GFCpbo1cB/PcWsaUAfcei7fnOhGRwWq5xkRAsJd uy6TlbkdmcqaRhxx3osfhNcE64GFjy5C558zl15EeI5rrw+aztlNxgU/IZixYXZcmR AXuwRMi6OdPmqjHZMDwGahM141bUSLoL348tZ+Y0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731636AbgANKL7 (ORCPT ); Tue, 14 Jan 2020 05:11:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:47808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731514AbgANKL6 (ORCPT ); Tue, 14 Jan 2020 05:11:58 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2C1EB207FF; Tue, 14 Jan 2020 10:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578996717; bh=y3hojQXEA8XV+d/pNvuWwQg0+T/RPwpbZaLgU7memec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NK+jxkqwKMHjnsGmNMWe9/M5vWMapUYTl9nAMu++iCYZ2RsOibexStEgeHbL85SCV 7Xxbk1l/h5IkI3PVTQiB8gftHT/r+JM9w41zjiuzkH+K/mRZnkC3SrMP9bq/zs9+9n 3wW2GOiv35eVxYUGo/0QSHEsbuteO7ey85jeCAFc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marcel Holtmann , Jiri Kosina Subject: [PATCH 4.9 09/31] HID: uhid: Fix returning EPOLLOUT from uhid_char_poll Date: Tue, 14 Jan 2020 11:02:01 +0100 Message-Id: <20200114094341.392739255@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200114094334.725604663@linuxfoundation.org> References: <20200114094334.725604663@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marcel Holtmann commit be54e7461ffdc5809b67d2aeefc1ddc9a91470c7 upstream. Always return EPOLLOUT from uhid_char_poll to allow polling /dev/uhid for writable state. Fixes: 1f9dec1e0164 ("HID: uhid: allow poll()'ing on uhid devices") Signed-off-by: Marcel Holtmann Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/uhid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/hid/uhid.c +++ b/drivers/hid/uhid.c @@ -26,6 +26,7 @@ #include #include #include +#include #define UHID_NAME "uhid" #define UHID_BUFSIZE 32 @@ -774,7 +775,7 @@ static unsigned int uhid_char_poll(struc if (uhid->head != uhid->tail) return POLLIN | POLLRDNORM; - return 0; + return EPOLLOUT | EPOLLWRNORM; } static const struct file_operations uhid_fops = {