2023-11-22 14:43:13

by Tomi Valkeinen

[permalink] [raw]
Subject: [PATCH 0/2] media: rkisp1: Fix memory leaks

Fix two memory leaks in rkisp1 driver.

Signed-off-by: Tomi Valkeinen <[email protected]>
---
Tomi Valkeinen (2):
media: rkisp1: Fix media device memory leak
media: rkisp1: Fix memory leaks in rkisp1_isp_unregister()

drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 1 +
2 files changed, 4 insertions(+)
---
base-commit: 1865913dd590ca6d5e3207b15099a1210dd62f29
change-id: 20231122-rkisp-fixes-c2795cafda52

Best regards,
--
Tomi Valkeinen <[email protected]>


2023-11-22 14:43:17

by Tomi Valkeinen

[permalink] [raw]
Subject: [PATCH 2/2] media: rkisp1: Fix memory leaks in rkisp1_isp_unregister()

Add missing call to v4l2_subdev_cleanup() to fix memory leak.

Fixes: 2cce0a369dbd ("media: rkisp1: isp: Use V4L2 subdev active state")
Signed-off-by: Tomi Valkeinen <[email protected]>
---
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
index 88ca8b2283b7..45d1ab96fc6e 100644
--- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
+++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
@@ -933,6 +933,7 @@ void rkisp1_isp_unregister(struct rkisp1_device *rkisp1)
return;

v4l2_device_unregister_subdev(&isp->sd);
+ v4l2_subdev_cleanup(&isp->sd);
media_entity_cleanup(&isp->sd.entity);
}


--
2.34.1

2023-11-22 15:16:31

by Tommaso Merciai

[permalink] [raw]
Subject: Re: [PATCH 2/2] media: rkisp1: Fix memory leaks in rkisp1_isp_unregister()

Hi Tomi,

On Wed, Nov 22, 2023 at 04:42:23PM +0200, Tomi Valkeinen wrote:
> Add missing call to v4l2_subdev_cleanup() to fix memory leak.
>
> Fixes: 2cce0a369dbd ("media: rkisp1: isp: Use V4L2 subdev active state")
> Signed-off-by: Tomi Valkeinen <[email protected]>
> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> index 88ca8b2283b7..45d1ab96fc6e 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> @@ -933,6 +933,7 @@ void rkisp1_isp_unregister(struct rkisp1_device *rkisp1)
> return;
>
> v4l2_device_unregister_subdev(&isp->sd);
> + v4l2_subdev_cleanup(&isp->sd);
> media_entity_cleanup(&isp->sd.entity);
> }
>
>
> --
> 2.34.1
>
>

Reviewed-by: Tommaso Merciai <[email protected]>

Thanks & Regards,
Tommaso

2023-11-22 15:45:57

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 2/2] media: rkisp1: Fix memory leaks in rkisp1_isp_unregister()

Hi Tomi,

Thank you for the patch.

On Wed, Nov 22, 2023 at 04:42:23PM +0200, Tomi Valkeinen wrote:
> Add missing call to v4l2_subdev_cleanup() to fix memory leak.
>
> Fixes: 2cce0a369dbd ("media: rkisp1: isp: Use V4L2 subdev active state")
> Signed-off-by: Tomi Valkeinen <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

> ---
> drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> index 88ca8b2283b7..45d1ab96fc6e 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
> @@ -933,6 +933,7 @@ void rkisp1_isp_unregister(struct rkisp1_device *rkisp1)
> return;
>
> v4l2_device_unregister_subdev(&isp->sd);
> + v4l2_subdev_cleanup(&isp->sd);
> media_entity_cleanup(&isp->sd.entity);
> }
>

--
Regards,

Laurent Pinchart