linux/drivers/gpu
Ruoyu Wang 2dc4ea9220 drm/mediatek: Check CRTC state before freeing
[ Upstream commit 233a4d3a39 ]

mtk_crtc_reset() destroys the current CRTC state only when crtc->state
is non-NULL, but it always converts crtc->state to struct mtk_crtc_state
and passes the result to kfree().

When reset is called without an existing state, container_of(NULL, ...)
does not produce NULL. Keep the mtk state free in the same crtc->state
guard as the helper state destruction.

This issue was found by a static analysis checker and confirmed by
manual source review.

Fixes: 2d267b8189 ("drm/mtk: Use __drm_atomic_helper_crtc_reset")
Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20260707150528.2270739-1-ruoyuw560@gmail.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2026-08-19 17:14:06 +02:00
..
drm drm/mediatek: Check CRTC state before freeing 2026-08-19 17:14:06 +02:00
host1x gpu: host1x: Fix device reference leak in host1x_device_parse_dt() error path 2026-07-24 15:51:47 +02:00
ipu-v3 gpu: ipu-v3: common: Add of_node_put() for reference returned by of_graph_get_port_by_id() 2023-03-10 09:39:20 +01:00
trace gpu/trace: add a gpu total memory usage tracepoint 2020-03-03 17:52:41 -05:00
vga vgaarb: don't pass a cookie to vga_client_register 2021-07-21 10:29:10 +02:00
Makefile gpu/trace: add a gpu total memory usage tracepoint 2020-03-03 17:52:41 -05:00