Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4278334ioo; Tue, 31 May 2022 00:17:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOX631f4c+85nzv6F8i0r+Y72txeBx8DQUZ5gVc6Rjz4I82FzUMAK4xKat8PvqxL0ld2zH X-Received: by 2002:a17:906:9b92:b0:6fd:e4ce:e416 with SMTP id dd18-20020a1709069b9200b006fde4cee416mr52554342ejc.394.1653981438166; Tue, 31 May 2022 00:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653981438; cv=none; d=google.com; s=arc-20160816; b=N29ocnHxyTQm9JFHum92dgjR296r/ksmvdkRy8bP/lFIus3fB7tG1MNF4QXBwkZhZe 9/BwXW1BPMsLvrfM7UKpCyOdv1K4se87au7I/+rZpAil3Z1rhlwekw8rnnCdrpYKDKvT 24d2C4iVAkYyh9xVy4qmgXw/XkfNYGo9P/I4oFxhTPfQszXZx4qXJbEonMzmr8qNAA2w gb/EbsR2xpfDmZ8SwzSY3IL6seaD5gncFzoJAh1YtHoDAJwlFhsEmOBcaS9sTAGVSxDJ rCL89D9+3kSC5ndGv8Iz38pL0MYZzOrLyxEn8AHWaCaPcxpSBMROq+IcAWiARnE+l3jk Iu0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=rKPo2AGtl9v+T3/r65Fqy2zoyM3rViRuXHvNqQu+x1c=; b=uxszhxTLUCXj8AZ3bZDxzPkFE7cAopLumSj6GnazRhlmO/42zZfdbxmIpVhZvf63A8 H54bRhf5HrJTAcspNZKOEH2HZF8DcUh6Zz9kwDNAadVbbs+XstfyL0dzuT/Th0D3cc/I p90orQZpk6gzAkSbJ9U2OUwMsB2kb0VE96hKtwJLgNFQV7GsxqzdM5hQTs/Ryi1hDuz2 lOZNh1posNcCWJaO6LAtQE8oNnCSefTBzUT3e1ti/HG/N8v74CxXU8qS66sL9YkFxsoQ B+hub7w4G1jqJ2oTxmLXshA5BMQDE0iGiSx6s8+gxLVVxJRCTydq0Pc8AG9D2667O1iA Othg== ARC-Authentication-Results: i=1; mx.google.com; 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 p2-20020a056402500200b0042d930aa536si9408118eda.429.2022.05.31.00.16.52; Tue, 31 May 2022 00:17:18 -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; 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 S233886AbiE3K3K (ORCPT + 99 others); Mon, 30 May 2022 06:29:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232016AbiE3K3J (ORCPT ); Mon, 30 May 2022 06:29:09 -0400 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1DA77C16B; Mon, 30 May 2022 03:29:01 -0700 (PDT) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 73F851C0B82; Mon, 30 May 2022 12:28:59 +0200 (CEST) Date: Mon, 30 May 2022 12:28:59 +0200 From: Pavel Machek To: Dmitry Torokhov Cc: Pavel Machek , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Zheng Yongjun , Sasha Levin Subject: Re: [PATCH 4.14 04/33] Input: stmfts - fix reference leak in stmfts_input_open Message-ID: <20220530102859.GA32111@duo.ucw.cz> References: <20220523165746.957506211@linuxfoundation.org> <20220523165747.818755611@linuxfoundation.org> <20220525105248.GA31002@duo.ucw.cz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NEUTRAL,T_SCC_BODY_TEXT_LINE autolearn=no 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 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > From: Zheng Yongjun > > >=20 > > > [ Upstream commit 26623eea0da3476446909af96c980768df07bbd9 ] > > >=20 > > > pm_runtime_get_sync() will increment pm usage counter even it > > > failed. Forgetting to call pm_runtime_put_noidle will result > > > in reference leak in stmfts_input_open, so we should fix it. > >=20 > > This is wrong, AFAICT. >=20 > Yes, I think you are right. How about below? Looks good to me. > Input: stmfts - do not leave device disabled in stmfts_input_open >=20 > From: Dmitry Torokhov >=20 > The commit 26623eea0da3 attempted to deal with potential leak of runtime > PM counter when opening the touchscreen device, however it ended up > erroneously dropping the counter in the case of successfully enabling the > device. >=20 > Let's address this by using pm_runtime_resume_and_get() and then executing > pm_runtime_put_sync() only when we fail to send "sense on" command to the > device. >=20 > Fixes: 26623eea0da3 ("Input: stmfts - fix reference leak in stmfts_input_= open") Reviewed-by: Pavel Machek Thank you, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYpScawAKCRAw5/Bqldv6 8vA0AJ0WjbKH+mFtXAIKAZ3By6pG9v1jhgCfTV013nZ/6CHe/OW8Cyz5Utg7wrE= =73fp -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm--