<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"><span style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">Acked-by: Slava Abramov <slava.abramov@amd.com></span><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 Colin King <colin.king@canonical.com><br>
<b>Sent:</b> Friday, June 28, 2019 10:45:17 AM<br>
<b>To:</b> Wang, Kevin(Yang); Rex Zhu; Quan, Evan; Deucher, Alexander; Koenig, Christian; Zhou, David(ChunMing); David Airlie; Daniel Vetter; amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org<br>
<b>Cc:</b> kernel-janitors@vger.kernel.org; linux-kernel@vger.kernel.org<br>
<b>Subject:</b> [PATCH] drm/amd/powerplay: fix incorrect assignments to mclk_mask and soc_mask</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Colin Ian King <colin.king@canonical.com><br>
<br>
There are null pointer checks on mlck_mask and soc_mask however the<br>
sclk_mask is being used in assignments in what looks to be a cut-n-paste<br>
coding error. Fix this by using the correct pointers in the assignments.<br>
<br>
Addresses-Coverity: ("Dereference after null check")<br>
Fixes: 2d9fb9b06643 ("drm/amd/powerplay: add function get_profiling_clk_mask for navi10")<br>
Signed-off-by: Colin Ian King <colin.king@canonical.com><br>
---<br>
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 4 ++--<br>
 1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c<br>
index 27e5c80..ac151da 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c<br>
@@ -1134,14 +1134,14 @@ static int navi10_get_profiling_clk_mask(struct smu_context *smu,<br>
                         ret = smu_get_dpm_level_count(smu, SMU_MCLK, &level_count);<br>
                         if (ret)<br>
                                 return ret;<br>
-                       *sclk_mask = level_count - 1;<br>
+                       *mclk_mask = level_count - 1;<br>
                 }<br>
 <br>
                 if(soc_mask) {<br>
                         ret = smu_get_dpm_level_count(smu, SMU_SOCCLK, &level_count);<br>
                         if (ret)<br>
                                 return ret;<br>
-                       *sclk_mask = level_count - 1;<br>
+                       *soc_mask = level_count - 1;<br>
                 }<br>
         }<br>
 <br>
-- <br>
2.7.4<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></div>
</span></font></div>
</body>
</html>