Skip to content

Commit f28cad8

Browse files
JoseExpositoalexdeucher
authored andcommitted
drm/amd/display: fix dereference before NULL check
The "plane_state" pointer was access before checking if it was NULL. Avoid a possible NULL pointer dereference by accessing the plane address after the check. Addresses-Coverity-ID: 1493892 ("Dereference before null check") Fixes: 3f68c01 ("drm/amd/display: add cyan_skillfish display support") Signed-off-by: José Expósito <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 6dc8265 commit f28cad8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,12 @@ void dcn201_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_ctx)
134134
PHYSICAL_ADDRESS_LOC addr;
135135
struct dc_plane_state *plane_state = pipe_ctx->plane_state;
136136
struct dce_hwseq *hws = dc->hwseq;
137-
struct dc_plane_address uma = plane_state->address;
137+
struct dc_plane_address uma;
138138

139139
if (plane_state == NULL)
140140
return;
141141

142+
uma = plane_state->address;
142143
addr_patched = patch_address_for_sbs_tb_stereo(pipe_ctx, &addr);
143144

144145
plane_address_in_gpu_space_to_uma(hws, &uma);

0 commit comments

Comments
 (0)