[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210226023946.5168-1-dingsenjie@163.com>
Date: Fri, 26 Feb 2021 10:39:46 +0800
From: dingsenjie@....com
To: dmitry.torokhov@...il.com, mcoquelin.stm32@...il.com,
alexandre.torgue@...com
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
dingsenjie <dingsenjie@...ong.com>
Subject: [PATCH] input: touchscreen: fix reference leak in stmfts_input_open
From: dingsenjie <dingsenjie@...ong.com>
pm_runtime_get_sync will increment pm usage counter even it
failed. Forgetting to pm_runtime_put_noidle will result in
reference leak in cedrus_start_streaming.
Signed-off-by: dingsenjie <dingsenjie@...ong.com>
---
drivers/input/touchscreen/stmfts.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
index 9a64e1d..b91a59b 100644
--- a/drivers/input/touchscreen/stmfts.c
+++ b/drivers/input/touchscreen/stmfts.c
@@ -338,8 +338,10 @@ static int stmfts_input_open(struct input_dev *dev)
int err;
err = pm_runtime_get_sync(&sdata->client->dev);
- if (err < 0)
+ if (err < 0) {
+ pm_runtime_put_noidle(&sdata->client->dev);
return err;
+ }
err = i2c_smbus_write_byte(sdata->client, STMFTS_MS_MT_SENSE_ON);
if (err)
--
1.9.1
Powered by blists - more mailing lists