mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
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>
This commit is contained in:
committed by
Hans Verkuil
parent
acc294519f
commit
71dfb2c754
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user