From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796389325; b=g4xTicqN+rVP/boX/mUgSC8RFRyTdOyzFRVku5DV515fBV75/StbyyL99s/FgcSHzVvx ft1BqKfPFXs8fYWP/7VXQ7hwqiy6kprrbjWlRgwYnlxL+RvJwtSISiL/vnd0g0P6FEBdw 1CHhMiquaryprBO/svdYdCSJXTXAX93EMG0c1eAWdlWKkasrwiwBqOjCqKKeHpdXe8jLF Soztph9Gr1V5PTjzhXP8nS1hoxpmfzlbUrjAeiyDfGRxNHNhUWpRDzV3C1hrJeue2resL YhGqJ7LhCySikE6i2d2CCPN/ZnjdEjPKUoNqKtIeeblDns8tqtvQSKy5fchz/iTClfA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389325; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=2Z0tRPVpiNTrjSdo1Z52aOUnmX5TErMqNh3+8fuvFK8=; b=pLYNRovyH4z98UOi2wP3EV2eDSj3PiecLVug7T5baRyU/YTzsHiL56/XtAWbKfAWmSvI JewOL4Sq7XMQH4jWOlUve4osLeTBvHMmgJDmp9UhjnttcWgb5VDMA6GVyE5tE7qya26AU 0/E+hE9nMaXap+SF9whxQ/HGCxy4PwTWOIwmS0YY5vwYIW9E+cvtdEK5PsTvw95u4baFE HibfJ06sQabPUA0zfl9L8FRXJenzMGCfteVa4AypHBnNOlVfp+qMTT6wOi0WjPrtxXLCz T1n6UdpyoXQ7MWpJN5/ItK+yMtGjiTEx5jJ9iLOhNkB6dDhI9rL1iaTE0T4DJF1z+iQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=gN3M5Amp; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D21A606A684; Fri, 4 Dec 2026 13:02:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=gN3M5Amp Received: by smtp.kernel.org (Postfix) with ESMTPSA id B72FB1F00897; Fri, 4 Dec 2026 13:02:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389325; bh=2Z0tRPVpiNTrjSdo1Z52aOUnmX5TErMqNh3+8fuvFK8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gN3M5AmpD+1ynmsbDBOwrkZOV5mO0ZlOA7ft7YQczdgMutKBp01fO1YffoKyUqvZ0 eewFr1bY6V9jcw2NUxas262qWbRhbPgkRHTHGctbfCzDraEi7+2HOK1wtfG88KgSN6 95yTQHgXA+m2ucCSLba/AcuW6lddL+lCbtyJ/oIk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wentao Liang , Dmitry Torokhov Subject: [PATCH 6.1 0950/1059] Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate() Date: Fri, 4 Dec 2026 19:08:01 +0900 Message-ID: <20261204100708.629611804@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wentao Liang commit f5f8cc539f8b2bd5324c03dfce8cca57284653e6 upstream. pm_runtime_get_sync() unconditionally increments the runtime PM usage counter. If mutex_lock_interruptible() is interrupted, the function returns without dropping that reference, so the usage count stays elevated for as long as the driver is bound and the device can no longer be autosuspended. Drop the reference on the error path. Use pm_runtime_put_autosuspend() rather than the synchronous variant there: nothing has been done to the device on this path, so there is nothing to wait for, and with the 2 s autosuspend delay the driver configures the put only arms the autosuspend timer instead of suspending the device. Fixes: 672865080a8f ("Input: cyapa - add runtime power management support") Cc: stable@vger.kernel.org Signed-off-by: Wentao Liang Link: https://patch.msgid.link/1794120347.2701234.vulab@iscas.ac.cn Signed-off-by: Dmitry Torokhov Signed-off-by: Greg Kroah-Hartman --- drivers/input/mouse/cyapa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/input/mouse/cyapa.c +++ b/drivers/input/mouse/cyapa.c @@ -904,8 +904,10 @@ static ssize_t cyapa_update_rt_suspend_s pm_runtime_get_sync(dev); error = mutex_lock_interruptible(&cyapa->state_sync_lock); - if (error) + if (error) { + pm_runtime_put_autosuspend(dev); return error; + } cyapa->runtime_suspend_sleep_time = min_t(u16, time, 1000); cyapa->runtime_suspend_power_mode =