[PATCH 1/1] drm/amd/display: do not dereference on NULL

Deucher, Alexander Alexander.Deucher at amd.com
Thu May 27 15:03:43 UTC 2021


[Public]

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
________________________________
From: Das, Nirmoy <Nirmoy.Das at amd.com>
Sent: Thursday, May 27, 2021 8:07 AM
To: Wentland, Harry <Harry.Wentland at amd.com>
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>; amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>; Das, Nirmoy <Nirmoy.Das at amd.com>
Subject: [PATCH 1/1] 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 <nirmoy.das at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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 1134cf6eac82..f2ed51484980 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -9108,7 +9108,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);

                 /*
--
2.31.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20210527/05146c50/attachment-0001.htm>


More information about the amd-gfx mailing list