Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/tegra: Fix a possible null pointer dereference

In tegra_crtc_reset(), new memory is allocated with kzalloc(), but
no check is performed. Before calling __drm_atomic_helper_crtc_reset,
state should be checked to prevent possible null pointer dereference.

Fixes: b7e0b04ae450 ("drm/tegra: Convert to using __drm_atomic_helper_crtc_reset() for reset.")
Cc: stable@vger.kernel.org
Signed-off-by: Qiu-ji Chen <chenqiuji666@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20241106095906.15247-1-chenqiuji666@gmail.com

authored by

Qiu-ji Chen and committed by
Thierry Reding
780351a5 3c364233

+4 -1
+4 -1
drivers/gpu/drm/tegra/dc.c
··· 1393 1393 if (crtc->state) 1394 1394 tegra_crtc_atomic_destroy_state(crtc, crtc->state); 1395 1395 1396 - __drm_atomic_helper_crtc_reset(crtc, &state->base); 1396 + if (state) 1397 + __drm_atomic_helper_crtc_reset(crtc, &state->base); 1398 + else 1399 + __drm_atomic_helper_crtc_reset(crtc, NULL); 1397 1400 } 1398 1401 1399 1402 static struct drm_crtc_state *