<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">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
<b>Sent:</b> Friday, November 30, 2018 10:09:28 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Li, Sun peng (Leo); Wentland, Harry; Kazlauskas, Nicholas<br>
<b>Subject:</b> [PATCH] drm/amd/display: Fix NULL ptr deref for commit_planes_to_stream</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[Why]<br>
With scaling, underscan and abm changes we can end up calling<br>
commit_planes_to_stream in commit_tail. This call uses dm_state->context<br>
which can be NULL if the commit was a fast update.<br>
<br>
[How]<br>
Use dc_state instead since that can't be NULL unless the system ran<br>
out of memory.<br>
<br>
Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=108912">https://bugs.freedesktop.org/show_bug.cgi?id=108912</a><br>
Fixes: e64abff2f133 ("drm/amd/display: Use private obj helpers for dm_atomic_state")<br>
<br>
Cc: Leo Li <sunpeng.li@amd.com><br>
Cc: Harry Wentland <harry.wentland@amd.com><br>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
---<br>
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-<br>
 1 file changed, 1 insertion(+), 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 76b1aebdca0c..8ecd78657d43 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>
@@ -5011,7 +5011,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)<br>
                                 status->plane_count,<br>
                                 dm_new_crtc_state,<br>
                                 to_dm_crtc_state(old_crtc_state),<br>
-                               dm_state->context))<br>
+                               dc_state))<br>
                         dm_error("%s: Failed to update stream scaling!\n", __func__);<br>
         }<br>
 <br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>