linux/drivers/gpu/drm/vc4
Alexander A. Klimov 5d563a5da8
drm/vc4: fix krealloc() memory leak
Don't just overwrite the original pointer passed to krealloc()
with its return value without checking latter:

    MEM = krealloc(MEM, SZ, GFP);

If krealloc() returns NULL, that erases the pointer
to the still allocated memory, hence leaks this memory.
Instead, use a temporary variable, check it's not NULL
and only then assign it to the original pointer:

    TMP = krealloc(MEM, SZ, GFP);
    if (!TMP) return;
    MEM = TMP;

While on it, use krealloc_array().

Fixes: 6d45c81d22 ("drm/vc4: Add support for branching in shader validation.")
Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patch.msgid.link/20260606123817.37222-1-grandmaster@al2klimov.de
2026-06-09 15:29:57 -03:00
..
tests drm/vc4: tests: Retry pv-muxing tests when EDEADLK 2025-04-07 10:29:45 +02:00
Kconfig drm/vc4: hdmi: switch to generic CEC helpers 2025-09-15 21:42:55 +03:00
Makefile
vc4_bo.c drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
vc4_crtc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vc4_debugfs.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
vc4_dpi.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
vc4_drv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vc4_drv.h drm/vc4: Replace IDR with XArray for perfmon tracking 2026-02-02 07:54:49 -03:00
vc4_dsi.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
vc4_fence.c
vc4_gem.c drm for v7.1-rc1 2026-04-15 08:45:00 -07:00
vc4_hdmi_phy.c drm/vc4: hdmi: Add support for BCM2712 HDMI controllers 2024-11-27 14:37:20 +00:00
vc4_hdmi_regs.h drm/vc4: hdmi: Add support for BCM2712 HDMI controllers 2024-11-27 14:37:20 +00:00
vc4_hdmi.c drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace 2026-03-24 13:54:35 +01:00
vc4_hdmi.h drm/display: hdmi: Use drm_output_color_format instead of hdmi_colorspace 2026-03-24 13:54:35 +01:00
vc4_hvs.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
vc4_irq.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
vc4_kms.c drm/atomic: Remove state argument to drm_atomic_private_obj_init 2026-03-20 10:03:11 +01:00
vc4_packet.h
vc4_perfmon.c Merge drm/drm-next into drm-misc-next 2026-02-23 11:48:20 +01:00
vc4_plane.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
vc4_qpu_defines.h
vc4_regs.h drm/vc4: hdmi: Support 2712 D-step register map 2024-11-27 14:37:21 +00:00
vc4_render_cl.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
vc4_trace_points.c
vc4_trace.h
vc4_txp.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
vc4_v3d.c drm/vc4: Release runtime PM reference after binding V3D 2026-04-02 07:53:16 -03:00
vc4_validate_shaders.c drm/vc4: fix krealloc() memory leak 2026-06-09 15:29:57 -03:00
vc4_validate.c drm: include drm_print.h where needed 2025-10-31 10:34:52 +02:00
vc4_vec.c drm: Discard pm_runtime_put() return value 2026-01-16 20:28:05 +01:00