On Tue Dec 23 11:19:01 2025 +0530, Abdun Nihaal wrote:
> In one of the error paths in tw9906_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: [email protected]
> Fixes: a000e9a02b58 ("[media] tw9906: add Techwell tw9906 video decoder")
> Signed-off-by: Abdun Nihaal <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/i2c/tw9906.c | 1 +
 1 file changed, 1 insertion(+)

---

diff --git a/drivers/media/i2c/tw9906.c b/drivers/media/i2c/tw9906.c
index 6220f4fddbab..0ab43fe42d7f 100644
--- a/drivers/media/i2c/tw9906.c
+++ b/drivers/media/i2c/tw9906.c
@@ -196,6 +196,7 @@ static int tw9906_probe(struct i2c_client *client)
 
        if (write_regs(sd, initial_registers) < 0) {
                v4l2_err(client, "error initializing TW9906\n");
+               v4l2_ctrl_handler_free(hdl);
                return -EINVAL;
        }
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to