<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Das, Nirmoy <Nirmoy.Das@amd.com><br>
<b>Sent:</b> Thursday, May 27, 2021 8:07 AM<br>
<b>To:</b> Wentland, Harry <Harry.Wentland@amd.com><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Das, Nirmoy <Nirmoy.Das@amd.com><br>
<b>Subject:</b> [PATCH 1/1] drm/amd/display: do not dereference on NULL</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">WARN_ON() will not kill the process so the second WARN_ON()<br>
will try to dereference NULL pointer.<br>
<br>
Signed-off-by: Nirmoy Das <nirmoy.das@amd.com><br>
---<br>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++++-<br>
1 file changed, 4 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index 1134cf6eac82..f2ed51484980 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -9108,7 +9108,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)<br>
}<br>
<br>
status = dc_stream_get_status(dm_new_crtc_state->stream);<br>
- WARN_ON(!status);<br>
+<br>
+ if (WARN_ON(!status))<br>
+ continue;<br>
+<br>
WARN_ON(!status->plane_count);<br>
<br>
/*<br>
-- <br>
2.31.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>