<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> S, Shirish<br>
<b>Sent:</b> Thursday, March 15, 2018 6:33:51 AM<br>
<b>To:</b> Deucher, Alexander; Wentland, Harry; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> S, Shirish<br>
<b>Subject:</b> [PATCH] drm/amd/display: fix dereferencing possible ERR_PTR()</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">This patch fixes static checker warning caused by<br>
"36cc549d5986: "drm/amd/display: disable CRTCs with<br>
NULL FB on their primary plane (V2)"<br>
<br>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com><br>
Signed-off-by: Shirish S <shirish.s@amd.com><br>
---<br>
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++<br>
 1 file changed, 3 insertions(+)<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 0564676..9e2cdc9 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>
@@ -4893,6 +4893,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,<br>
                         return -EDEADLK;<br>
 <br>
                 crtc_state = drm_atomic_get_crtc_state(plane_state->state, crtc);<br>
+               if (IS_ERR(crtc_state))<br>
+                       return PTR_ERR(crtc_state);<br>
+<br>
                 if (crtc->primary == plane && crtc_state->active) {<br>
                         if (!plane_state->fb)<br>
                                 return -EINVAL;<br>
-- <br>
2.7.4<br>
<br>
</div>
</span></font></div>
</body>
</html>