summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2026-03-28 21:18:09 +0300
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-05-05 17:57:02 +0300
commit50cc0e547da50b887e63dfa1ad203cd5b735d01e (patch)
tree569858a217f96ac65eeb95d3adebd5f73f222a0d /include/linux
parent60ca00792bce46ec170c7ed101f376186d4cf8a9 (diff)
downloadlinux-50cc0e547da50b887e63dfa1ad203cd5b735d01e.tar.xz
media: nuvoton: npcm-video: fix memory leaks in probe and remove
npcm_video_probe() allocates the npcm_video structure with kzalloc_obj() but never frees it on any probe error path or in npcm_video_remove(), leaking the allocation on every failed probe and every normal unbind. Additionally, when npcm_video_setup_video() fails, the reserved memory association established by of_reserved_mem_device_init() in npcm_video_init() is not released, leaking the rmem_assigned_device entry on the global list. Fix both by adding kfree(video) to all probe error paths and to npcm_video_remove(), and adding the missing of_reserved_mem_device_release() call when npcm_video_setup_video() fails. Fixes: 46c15a4ff1f4 ("media: nuvoton: Add driver for NPCM video capture and encoding engine") Cc: stable@vger.kernel.org Signed-off-by: David Carlier <devnexen@gmail.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions