[PATCH 51/57] media: atomisp: ov2722: Call atomisp_gmin_remove_subdev() on probe failure

Hans de Goede
2023-01-23T12:55:36Z

Call atomisp_gmin_remove_subdev() on probe failure to properly free
the GPIOs and other resources acquired by the gmin_camera_platform_data()
call earlier.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
index d819ab5de28a..d874e12da8cc 100644
--- a/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
+++ b/drivers/staging/media/atomisp/i2c/atomisp-ov2722.c
@@ -994,6 +994,7 @@ static int ov2722_probe(struct i2c_client *client)
v4l2_ctrl_handler_free(&dev->ctrl_handler);

out_free:
+ atomisp_gmin_remove_subdev(&dev->sd);
v4l2_device_unregister_subdev(&dev->sd);
kfree(dev);
return ret;
--
2.39.0