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=1796380976; b=L5qzOfUqtNfpfeUzd4JffCieFnrm1YRaEcceVczGUS6z5bV1cNvsbpoMUtv7nbzsgxr4 RQeQg3qyLPKWZhglU00C/7o8vEMua7i/keCBlDni89OnF7Ni6rkV7hPuEHGkSKPkzRWb5 SwOuoel0OuhqHytQH3Qn7eJslNPG7NC00tDTQKm2LYnRwa8fXU5Sasjv3JYEEZ+cpD4DE saz9eLmSeUoS+Piuz+pkOm5lO926OComkMiDccxOziBcri6WR597KxL5KujHx62yH7nwh Ty/pjrGVegrUooNh2sTPcL6wyN/+cXgMDi8C1xe4CiAzXIawDqBsJZRrs0m3GwTkBYw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380976; 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=y9Q2u9GsNWFxlPRROU6Y2C1v1YkSnaamzke5T5nsumg=; b=EkvA9sS846OcxVmfdAsDefWDjhZlGjdgC3RdPL89NToW8zKocgm1DIv/6LDo5PigQg8J aJHuo1RXmv5MWtYtuwyXv0YbPMTyg0gLFHCYoRO/Qthz63BDYf+V3A/kx0cJx6m8XbVNr cP3AiRv2iByhj1dBQhb7vGC9SjJVj6Gt67dS34GmJ5vmsJnwwMgPTprw2NZ0EJdaVgCr9 q2jVV1SHh24T1m+fuECD2q9eIETxlDM65vfwMYPKV0k6wt0iv4agQ6VbijGmfmC9Krtx5 08IlWgtC0/WWLPdHN9JCy1tP8WZ9L00ipFWhJSNqqcXiqcgAhjDlQ+CdhNtg0YCcDeQ== 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=UIfQDMZc; 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 EE26B606A683; Fri, 4 Dec 2026 10:42:55 +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=UIfQDMZc Received: by smtp.kernel.org (Postfix) with ESMTPSA id 642301F000CE; Fri, 4 Dec 2026 10:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380975; bh=y9Q2u9GsNWFxlPRROU6Y2C1v1YkSnaamzke5T5nsumg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UIfQDMZczooak2zbLJ2sK89yLsrUtFFcjvRBm0i6d+BO8bYUxOBCg3Pe8eWU36Hc+ jCWiujRubyQ2VhweMwS3etxHDC5ynboupeOlwMU3eNMWCpkDv1RCp0gPIMcKYMf/aB 4dv9h/lfJVI6KQVv9b2rlVhN4Z1dImvPWyks2jts= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wentao Liang , Dmitry Torokhov Subject: [PATCH 7.3 505/742] Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate() Date: Fri, 4 Dec 2026 19:06:09 +0900 Message-ID: <20261204100648.556370036@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-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 @@ -901,8 +901,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 =