| 50cc0e54 | 28-Mar-2026 |
David Carlier <devnexen@gmail.com> |
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_
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>
show more ...
|
| e2ff3200 | 08-Apr-2025 |
Michael Chang <zhang971090220@gmail.com> |
media: nuvoton: npcm-video: Prevent returning unsupported resolutions
To restrict the returned resolution due to Nuvoton SoC hardware limitations.
Signed-off-by: Michael Chang <zhang971090220@gmail
media: nuvoton: npcm-video: Prevent returning unsupported resolutions
To restrict the returned resolution due to Nuvoton SoC hardware limitations.
Signed-off-by: Michael Chang <zhang971090220@gmail.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
show more ...
|
| 453d5cad | 24-Feb-2025 |
Ricardo Ribalda <ribalda@chromium.org> |
media: nuvoton: Fix reference handling of ece_pdev
When we obtain a reference to of a platform_device, we need to release it via put_device.
Found by cocci: ./platform/nuvoton/npcm-video.c:1677:3-9
media: nuvoton: Fix reference handling of ece_pdev
When we obtain a reference to of a platform_device, we need to release it via put_device.
Found by cocci: ./platform/nuvoton/npcm-video.c:1677:3-9: ERROR: missing put_device; call of_find_device_by_node on line 1667, but without a corresponding object release within this function. ./platform/nuvoton/npcm-video.c:1684:3-9: ERROR: missing put_device; call of_find_device_by_node on line 1667, but without a corresponding object release within this function. ./platform/nuvoton/npcm-video.c:1690:3-9: ERROR: missing put_device; call of_find_device_by_node on line 1667, but without a corresponding object release within this function. ./platform/nuvoton/npcm-video.c:1694:1-7: ERROR: missing put_device; call of_find_device_by_node on line 1667, but without a corresponding object release within this function.
Instead of manually calling put_device, use the __free macros.
Cc: stable@vger.kernel.org Fixes: 46c15a4ff1f4 ("media: nuvoton: Add driver for NPCM video capture and encoding engine") Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
show more ...
|