Skip to content

Draft: CVE-2024-27077: media: v4l2-mem2mem: fix a memleak in v4l2_m2m_register_entity

JIRA: https://issues.redhat.com/browse/RHEL-35186
CVE: CVE-2024-27077

media: v4l2-mem2mem: fix a memleak in v4l2_m2m_register_entity

The entity->name (i.e. name) is allocated in v4l2_m2m_register_entity
but isn't freed in its following error-handling paths. This patch
adds such deallocation to prevent memleak of entity->name.

Fixes: be2fff656322 ("media: add helpers for memory-to-memory media controller")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
(cherry picked from commit 8f94b49a5b5d386c038e355bef6347298aabd211)

Signed-off-by: cki-backport-bot cki-ci-bot+cki-gitlab-backport-bot@redhat.com

Merge request reports