Commit fcddb570 authored by Zhipeng Lu's avatar Zhipeng Lu Committed by Yipeng Zou
Browse files

media: v4l2-mem2mem: fix a memleak in v4l2_m2m_register_entity

stable inclusion
from stable-v5.10.214
commit afd2a82fe300032f63f8be5d6cd6981e75f8bbf2
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9L9JK
CVE: CVE-2024-27077

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=afd2a82fe300032f63f8be5d6cd6981e75f8bbf2



--------------------------------

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: be2fff65 ("media: add helpers for memory-to-memory media controller")
Signed-off-by: default avatarZhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarYipeng Zou <zouyipeng@huawei.com>
parent 48d72040
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment