Commit f28cad86 authored by José Expósito's avatar José Expósito Committed by Alex Deucher
Browse files

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: 3f68c01b ("drm/amd/display: add cyan_skillfish display support")
Signed-off-by: default avatarJosé Expósito <jose.exposito89@gmail.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 6dc8265f
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -134,11 +134,12 @@ void dcn201_update_plane_addr(const struct dc *dc, struct pipe_ctx *pipe_ctx)
	PHYSICAL_ADDRESS_LOC addr;
	struct dc_plane_state *plane_state = pipe_ctx->plane_state;
	struct dce_hwseq *hws = dc->hwseq;
	struct dc_plane_address uma = plane_state->address;
	struct dc_plane_address uma;

	if (plane_state == NULL)
		return;

	uma = plane_state->address;
	addr_patched = patch_address_for_sbs_tb_stereo(pipe_ctx, &addr);

	plane_address_in_gpu_space_to_uma(hws, &uma);