All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: i2c: ov5648: Free V4L2 fwnode data on unbind
@ 2022-09-19  2:32 Rafael Mendonca
  2022-09-19 14:32 ` Tommaso Merciai
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Rafael Mendonca @ 2022-09-19  2:32 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Paul Kocialkowski, Sakari Ailus
  Cc: Rafael Mendonca, Mauro Carvalho Chehab, linux-media, linux-kernel

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);
+
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-09-20 14:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19  2:32 [PATCH] media: i2c: ov5648: Free V4L2 fwnode data on unbind Rafael Mendonca
2022-09-19 14:32 ` Tommaso Merciai
2022-09-20 12:46 ` Jacopo Mondi
2022-09-20 13:25 ` Paul Kocialkowski
2022-09-20 13:58   ` Rafael Mendonca
2022-09-20 14:07     ` Paul Kocialkowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.