lkml.org 
[lkml]   [2022]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] media: i2c: ov5648: Free V4L2 fwnode data on unbind
Hi Rafael

On Sun, Sep 18, 2022 at 11:32:46PM -0300, Rafael Mendonca wrote:
> 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 <rafaelmendsr@gmail.com>
> ---
> drivers/media/i2c/ov5648.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/i2c/ov5648.c b/drivers/media/i2c/ov5648.c
> index dfcd33e9ee13..95850f06112b 100644
> --- a/drivers/media/i2c/ov5648.c
> +++ b/drivers/media/i2c/ov5648.c
> @@ -2598,6 +2598,8 @@ static int ov5648_remove(struct i2c_client *client)
> mutex_destroy(&sensor->mutex);
> media_entity_cleanup(&subdev->entity);
>
> + v4l2_fwnode_endpoint_free(&sensor->endpoint);
> +

Nit: all the other function calls are in a single block, this one
doesn't deserve an empty line before it.

Nit apart, the patch is a good fix.


> return 0;
> }
>
> --
> 2.34.1
>

\
 
 \ /
  Last update: 2022-09-20 14:47    [W:0.122 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site