[PATCH 07/13] platform/raspberrypi: vchiq-mmal: Free the event context for control ports

From: Jai Luthra

Date: Fri Oct 31 2025 - 13:28:43 EST


From: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>

vchiq_mmal_component_init calls init_event_context for the
control port, but vchiq_mmal_component_finalise didn't free
it, causing a memory leak..

Add the free call.

Signed-off-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>
Signed-off-by: Jai Luthra <jai.luthra@xxxxxxxxxxxxxxxx>
---
drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c b/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c
index 6381495fc3867013f74bd3754ed64e0a1ce01574..36f3b068c825e6a26508aefe544f7061c9559510 100644
--- a/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/platform/raspberrypi/vchiq-mmal/mmal-vchiq.c
@@ -1902,6 +1902,8 @@ int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
for (idx = 0; idx < component->clocks; idx++)
free_event_context(&component->clock[idx]);

+ free_event_context(&component->control);
+
mutex_unlock(&instance->vchiq_mutex);

return ret;

--
2.51.0