diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2025-01-10 10:33:33 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2025-02-15 17:22:46 +0300 |
commit | 71dfb2c7548994aad6cb0a316c2601e7144d15a5 (patch) | |
tree | 34c25f725573cdeef769f0088dbd7d3cf7fcc36c | |
parent | acc294519f1749041e1b8c74d46bbf6c57d8b061 (diff) | |
download | linux-71dfb2c7548994aad6cb0a316c2601e7144d15a5.tar.xz |
media: i2c: ov2740: Free control handler on error path
The control handler wasn't freed if v4l2_fwnode_device_parse() failed. Do
that now.
Co-developed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r-- | drivers/media/i2c/ov2740.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/i2c/ov2740.c b/drivers/media/i2c/ov2740.c index 9a5d118b87b0..04e93618f408 100644 --- a/drivers/media/i2c/ov2740.c +++ b/drivers/media/i2c/ov2740.c @@ -828,8 +828,10 @@ static int ov2740_init_controls(struct ov2740 *ov2740) 0, 0, ov2740_test_pattern_menu); ret = v4l2_fwnode_device_parse(&client->dev, &props); - if (ret) + if (ret) { + v4l2_ctrl_handler_free(ctrl_hdlr); return ret; + } v4l2_ctrl_new_fwnode_properties(ctrl_hdlr, &ov2740_ctrl_ops, &props); |