From: Nirmoy Das Date: Thu, 27 May 2021 12:03:33 +0000 (+0200) Subject: drm/amd/display: do not dereference on NULL X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=57738ae40f33c8903e84863acb17cb7c919d69a3;p=linux.git drm/amd/display: do not dereference on NULL WARN_ON() will not kill the process so the second WARN_ON() will try to dereference NULL pointer. Signed-off-by: Nirmoy Das Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index f14700a0515ad..4fd6f4a7d3921 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -9013,7 +9013,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) } status = dc_stream_get_status(dm_new_crtc_state->stream); - WARN_ON(!status); + + if (WARN_ON(!status)) + continue; + WARN_ON(!status->plane_count); /*