diff options
| author | Abdun Nihaal <nihaal@cse.iitm.ac.in> | 2025-12-23 11:18:13 +0530 |
|---|---|---|
| committer | Sasha Levin <sashal@kernel.org> | 2026-03-04 07:20:15 -0500 |
| commit | e54aa17c968c4de2c5f7b7ea390c63d33c07513b (patch) | |
| tree | 42fe1ab1c760f7a3c77a62a1d086d2fd65ec857e /drivers | |
| parent | f3b05f50b2111e52d916c21ee7662cd1fe1cf402 (diff) | |
media: i2c/tw9903: Fix potential memory leak in tw9903_probe()
[ Upstream commit 9cea16fea47e5553f51d10957677ff735b1eff03 ]
In one of the error paths in tw9903_probe(), the memory allocated in
v4l2_ctrl_handler_init() and v4l2_ctrl_new_std() is not freed. Fix that
by calling v4l2_ctrl_handler_free() on the handler in that error path.
Cc: stable@vger.kernel.org
Fixes: 0890ec19c65d ("[media] tw9903: add new tw9903 video decoder")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/media/i2c/tw9903.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/i2c/tw9903.c b/drivers/media/i2c/tw9903.c index f8e3ab4909d8..37d5ab684642 100644 --- a/drivers/media/i2c/tw9903.c +++ b/drivers/media/i2c/tw9903.c @@ -229,6 +229,7 @@ static int tw9903_probe(struct i2c_client *client, if (write_regs(sd, initial_registers) < 0) { v4l2_err(client, "error initializing TW9903\n"); + v4l2_ctrl_handler_free(hdl); return -EINVAL; } |
