From: Rafael Mendonca Date: Tue, 20 Sep 2022 14:27:48 +0000 (-0300) Subject: media: i2c: ov5648: Free V4L2 fwnode data on unbind X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c95770e4fc172696dcb1450893cda7d6324d96fc;p=linux.git media: i2c: ov5648: Free V4L2 fwnode data on unbind The V4L2 fwnode data structure doesn't get freed on unbind, which leads to a memleak. Fixes: e43ccb0a045f ("media: i2c: Add support for the OV5648 image sensor") Signed-off-by: Rafael Mendonca Reviewed-by: Tommaso Merciai Reviewed-by: Paul Kocialkowski Signed-off-by: Sakari Ailus --- diff --git a/drivers/media/i2c/ov5648.c b/drivers/media/i2c/ov5648.c index 84604ea7bdf9e..17465fcf28e33 100644 --- a/drivers/media/i2c/ov5648.c +++ b/drivers/media/i2c/ov5648.c @@ -2597,6 +2597,7 @@ static void ov5648_remove(struct i2c_client *client) v4l2_ctrl_handler_free(&sensor->ctrls.handler); mutex_destroy(&sensor->mutex); media_entity_cleanup(&subdev->entity); + v4l2_fwnode_endpoint_free(&sensor->endpoint); } static const struct dev_pm_ops ov5648_pm_ops = {