All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: cyapa - Fix rumtime PM imbalance on error
@ 2021-04-07  4:07 Dinghao Liu
  2021-04-08  6:19 ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Dinghao Liu @ 2021-04-07  4:07 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Dmitry Torokhov, Fuqian Huang, Benson Leung,
	Andrzej Pietrasiewicz, Lee Jones, linux-input, linux-kernel

When mutex_lock_interruptible() fails, a pairing PM usage
counter decrement is needed to keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/input/mouse/cyapa.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
index 77cc653edca2..e411ab45a218 100644
--- a/drivers/input/mouse/cyapa.c
+++ b/drivers/input/mouse/cyapa.c
@@ -904,8 +904,10 @@ static ssize_t cyapa_update_rt_suspend_scanrate(struct device *dev,
 	pm_runtime_get_sync(dev);
 
 	error = mutex_lock_interruptible(&cyapa->state_sync_lock);
-	if (error)
+	if (error) {
+		pm_runtime_put_noidle(dev);
 		return error;
+	}
 
 	cyapa->runtime_suspend_sleep_time = min_t(u16, time, 1000);
 	cyapa->runtime_suspend_power_mode =
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-08  6:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  4:07 [PATCH] Input: cyapa - Fix rumtime PM imbalance on error Dinghao Liu
2021-04-08  6:19 ` Dmitry Torokhov
2021-04-08  6:29   ` dinghao.liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.