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=1796382542; b=UcQkHkmMNcnTG08ODsY2JyolFDFWns5AOfa6Kaah92YergUWqMncM3c1vrfztSKLHKTB 5KRUdoyJpKuS4GoHL6oX87XkjQeeQZC7l8e7L/oT5GnefyTUzYsf36OImCjhBfvM23R5i hZRErgzBdX15pESOWwwi5OLon/XUd0Dms8XV7z8UgwWHifHBWRj3oAQ0uP7hhu6Xr5pgP XdgE3ATCj9AIk4/4y4QWShHiLUHwNirFkEL5XtwUs+CmeZ3pSonFCkeM5rkT4jBF6I00/ PlI+9pQt/FzcSEvapdGtD0Y7odFQ3S9cEO9+8ZfYxbWeaqzwJymgvTJdvd8tDFWrpKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382542; 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=5RlyuAduMGm2nPVq3XwdpCjt5PCg2KKfF3B1XUqbkAU=; b=A/SYvOnn3maaTabc9D4F+aWyj8PhHx1PTWjee2NDbS5zDfT59A/cFY03jdi5b9WS0/zu niTdTKl1OuMZ8ETY5mSuQJ1eL9P32WizcE/rBJdr87qH4r06VSAco6v99SdE1cuLyueog RaHk8R6q/lGXI6/+HlRTaV8ynsLSLuOMYW9my/sh5kwk3sfdJQWMgSEtaOXIm1ENt5xZr V0R+ag7g2yOJO1gR6mCdcYbDPOEsSsB+MOrq4sBEHYQAnSDbktiBwpH8RcgilPjtqpE9g R/znRP2Rhtd8KmmIUY6hS/mv1pQF9FFOmQSr83n6Z+6Pid1I4EU7aZjgcE/TkgYIqrg== 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=EeVMO8Ly; 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 057FE606A322; Fri, 4 Dec 2026 11:09:02 +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=EeVMO8Ly Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69D0F1F000C2; Fri, 4 Dec 2026 11:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382541; bh=5RlyuAduMGm2nPVq3XwdpCjt5PCg2KKfF3B1XUqbkAU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EeVMO8LyNz3NYGu9kWu1cUi6JAzsQXtbHit9a6SStDyhZ+OqCCVbeyCe7FjfukY8W qklRolQdRQfEyRq+X0VbEMfsJZmKRKrvKGu/rcTILxFiU2s1m1vPTaq/Wjn12dTYV9 N7gFNXDIyteh0jOSjp2eQBD354n53KRLxak4ulYY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wentao Liang , Dmitry Torokhov Subject: [PATCH 6.18 456/703] Input: cyapa - fix runtime PM leak in cyapa_update_rt_suspend_scanrate() Date: Fri, 4 Dec 2026 19:05:55 +0900 Message-ID: <20261204100639.917406750@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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.18-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 =