Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8285rwr; Wed, 3 May 2023 21:23:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ47rcES0IUcQk4rK90v2lfKcxdaFBOxNezdD2kaHgjRRpoFNjPW6pCpLehjuWLpwTONwpw3 X-Received: by 2002:a05:6a00:1a89:b0:634:7ba3:d142 with SMTP id e9-20020a056a001a8900b006347ba3d142mr1032435pfv.10.1683174201100; Wed, 03 May 2023 21:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683174201; cv=none; d=google.com; s=arc-20160816; b=rW++LhiQH5+F+e7ebs2zs9b/ZpYxMEXloIlus6qYN0PwMc0+8yTuP4p+ntCi7nS0L+ CyhsRQAUxgKKIEs6koO4ZrE//xR/Y1AmVGFK8Vwpckz46hh9fCi21/3sCMxv0d1SUWvP Mc+yMPlz5g3AnrcH0oODfk2OGPfVQbFn7pGDK0NSOli7muhJ0TQLVn/EIa48fEXscU6R elXad3a2VxXDjVv7OjaxoODBp8gXZk1bOYrat2IKpNSZFW92gACASoltms3HFrVYoQ2A +z+07nK80pMzC3sP7bEaDO4ncKcjqIJI7s/IjAwMOApO3BJCgJZO4hNKjXiqkOyPAA9D P6wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature:dkim-signature; bh=sBOpqE6ZyD5TuQjQQQ+LegbaXjUHqO7D3JUbKKQLkRE=; b=kun5al5b9pLPxGAnb552vxX+24rBPa6YcnKuJbkhsluzz80UX/Rmk5VQ5p0OUZPuQW 8YWDE8CC2DuaqPEk78KlIClTNfMV5Mu2Fmq44nHyvX4A63TRnNnLaBimFHMN5lr0M09I f43Hh/iqjyk5ofUcJhesJOQ6YMmP5SioL4aDSIadFAwZPx3uN9Dwq/lBEIY9OwWR97D3 zM1G85HO0BvQfcuMaPoxErS+KY7YEnq55QAgb1AbOMdR5Tx8YYEhHc5bvSmRwGuqHjqx 8AJk/oai1H1tuGIq2ZqbojRWwS0mRthKS4wOJPd6efQfVt9ldC66VhFW1xps8Znxkhb6 X+8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@who-t.net header.s=fm2 header.b=hNketbjB; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=EGdMeReh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 79-20020a630252000000b005287c9c425csi15190014pgc.407.2023.05.03.21.23.07; Wed, 03 May 2023 21:23:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@who-t.net header.s=fm2 header.b=hNketbjB; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=EGdMeReh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbjEDESt (ORCPT + 99 others); Thu, 4 May 2023 00:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjEDESp (ORCPT ); Thu, 4 May 2023 00:18:45 -0400 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4616D1BD3; Wed, 3 May 2023 21:18:30 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 54F9732000E5; Thu, 4 May 2023 00:18:27 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 04 May 2023 00:18:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=who-t.net; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1683173906; x=1683260306; bh=sB OpqE6ZyD5TuQjQQQ+LegbaXjUHqO7D3JUbKKQLkRE=; b=hNketbjBsMKpiS6r2v e3HvheuyyvEf8+BBmu4s23Re46Cz9dPRzMVAKB7d9wjjynOZmeooKAQdthGdGWMt QrL9dbsbsGO0iih6jMYyCxF4YWHG5kR1tzFgla2B0q45IoknUt2IQPWSzvuioJi8 IW9BqRbHFsvlcRKi8n8p9gqwP7O70JcAKKeq9a8e+/kekYsObpIHbNYc4+o/i4oa +a0k7Eit0yAYeTPyA1wfptfwPupiE7C5i6gw9VHFY8PyvX8KI9yNc414LMbMze4w 4qxCJ4JrX6a8CzDaklXV/8wYox98XDfehEXwkrzMVv02UlBIGYMfHQ0n0ZCHo3b9 Kfzg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1683173906; x=1683260306; bh=sBOpqE6ZyD5Tu QjQQQ+LegbaXjUHqO7D3JUbKKQLkRE=; b=EGdMeRehyrYOs0b9gDRZbs/6gnW0f KXbjpqCFuIlv0XCDgonnutdIgksx1hudzBQFOtFJhSr5Tx7Pnyqz1XAXD4ZquZF7 Dln8VtjiSDGeExs1OZPkp4hzGNnS2D9/fZx/DNdi9+wEyH4vY/PcRT1qeZsF4yNX SrxPucUneyZd06d+fc/Cp8lN5h4srupVCtC8N/F1dDs4Vv69fMu9O3V17W80cBuV sHbLTm7YSmiZLvHKD4zgjRRZXLzo1nAOTlhGFI0lcyheLwkEve/blAp5MG9Lehdb DrzoOHEF0eQZQUrUfm8OHdCAosMpBImHOKb/iwmvD/tDomGrW4UoTLiEg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedvledgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheprfgvthgv rhcujfhuthhtvghrvghruceophgvthgvrhdrhhhuthhtvghrvghrseifhhhoqdhtrdhnvg htqeenucggtffrrghtthgvrhhnpeekvdekgeehfeejgfdvudffhfevheejffevgfeigfek hfduieefudfgtedugfetgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehpvghtvghrrdhhuhhtthgvrhgvrhesfihhohdqthdrnhgvth X-ME-Proxy: Feedback-ID: i7ce144cd:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 May 2023 00:18:25 -0400 (EDT) Date: Thu, 4 May 2023 14:18:19 +1000 From: Peter Hutterer To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Input: fix open count when closing inhibited device Message-ID: <20230504041819.GA1128727@quokka> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 02, 2023 at 01:34:27PM -0700, Dmitry Torokhov wrote: > Because the kernel increments device's open count in input_open_device() > even if device is inhibited, the counter should always be decremented in > input_close_device() to keep it balanced. > > Fixes: a181616487db ("Input: Add "inhibited" property") > Signed-off-by: Dmitry Torokhov Yep. Reviewed-by: Peter Hutterer Cheers, Peter > --- > drivers/input/input.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/input.c b/drivers/input/input.c > index f791d14ecf23..8c5fdb0f858a 100644 > --- a/drivers/input/input.c > +++ b/drivers/input/input.c > @@ -705,7 +705,7 @@ void input_close_device(struct input_handle *handle) > > __input_release_device(handle); > > - if (!dev->inhibited && !--dev->users) { > + if (!--dev->users && !dev->inhibited) { > if (dev->poller) > input_dev_poller_stop(dev->poller); > if (dev->close) > -- > 2.40.1.495.gc816e09b53d-goog > > > -- > Dmitry