Skip to contentSkip to conversation

drm/amd/display: do not dereference on NULL

PATCH In review Nirmoy Das 2 participants 2 messages May 27, 2021

Subsystems (3)
lore
Share & tools
lore

Nirmoy Das

author
#0 lore raw

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.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -1
index 1134cf6eac82..f2ed51484980 100644
@@ -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);
 
 		/*
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
maintainer Reviewed-by on v1 1/1
#1 lore raw

[Public]

________________________________
From: Das, Nirmoy <[email protected]>
Sent: Thursday, May 27, 2021 8:07 AM
To: Wentland, Harry <[email protected]>
Cc: Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected] <[email protected]>; Das, Nirmoy <[email protected]>
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.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +4 -1
index 1134cf6eac82..f2ed51484980 100644
@@ -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

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx