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/sun4i: backend: fix error pointer dereference

The function drm_atomic_get_plane_state() can return an error pointer
and is not checked for it. Add error pointer check.

Detected by Smatch:
drivers/gpu/drm/sun4i/sun4i_backend.c:496 sun4i_backend_atomic_check() error:
'plane_state' dereferencing possible ERR_PTR()

Fixes: 96180dde23b79 ("drm/sun4i: backend: Add a custom atomic_check for the frontend")
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Link: https://patch.msgid.link/20260217014801.60760-1-ethantidmore06@gmail.com
Signed-off-by: Chen-Yu Tsai <wens@kernel.org>

authored by

Ethan Tidmore and committed by
Chen-Yu Tsai
06277983 74462990

+3
+3
drivers/gpu/drm/sun4i/sun4i_backend.c
··· 491 491 drm_for_each_plane_mask(plane, drm, crtc_state->plane_mask) { 492 492 struct drm_plane_state *plane_state = 493 493 drm_atomic_get_plane_state(state, plane); 494 + if (IS_ERR(plane_state)) 495 + return PTR_ERR(plane_state); 496 + 494 497 struct sun4i_layer_state *layer_state = 495 498 state_to_sun4i_layer_state(plane_state); 496 499 struct drm_framebuffer *fb = plane_state->fb;