summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-12-04 12:18:37 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2022-12-04 12:18:37 -0800
commit50f36c5aa12c8d0f2adca662e0c106212ea897a8 (patch)
treeb1d631285b925629b8158396b22789bb480ece71 /drivers
parentc2bf05db6c78f53ca5cd4b48f3b9b71f78d215f1 (diff)
parent8c9a59939deb4bfafdc451100c03d1e848b4169b (diff)
Merge tag 'input-for-v6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fix from Dmitry Torokhov: - a fix for Raydium touchscreen driver to stop leaking memory when sending commands to the chip * tag 'input-for-v6.1-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send()
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/touchscreen/raydium_i2c_ts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 3a4952935366..3d9c5758d8a4 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -211,12 +211,14 @@ static int raydium_i2c_send(struct i2c_client *client,
error = raydium_i2c_xfer(client, addr, xfer, ARRAY_SIZE(xfer));
if (likely(!error))
- return 0;
+ goto out;
msleep(RM_RETRY_DELAY_MS);
} while (++tries < RM_MAX_RETRIES);
dev_err(&client->dev, "%s failed: %d\n", __func__, error);
+out:
+ kfree(tx_buf);
return error;
}