<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, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; 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 11:13:54 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][next] drm/amd/powerplay: fix out of memory check on od8_settings</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>
The null pointer check on od8_settings is currently the opposite of what<br>
it is intended to do. Fix this by adding in the missing ! operator.<br>
<br>
Addressed-Coverity: ("Resource leak")<br>
Fixes: 0c83d32c565c ("drm/amd/powerplay: simplified od_settings for each asic")<br>
Signed-off-by: Colin Ian King <colin.king@canonical.com><br>
---<br>
 drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 3 +--<br>
 1 file changed, 1 insertion(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c<br>
index 0f14fe14ecd8..eb9e6b3a5265 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c<br>
@@ -1501,8 +1501,7 @@ static int vega20_set_default_od8_setttings(struct smu_context *smu)<br>
                 return -EINVAL;<br>
 <br>
         od8_settings = kzalloc(sizeof(struct vega20_od8_settings), GFP_KERNEL);<br>
-<br>
-       if (od8_settings)<br>
+       if (!od8_settings)<br>
                 return -ENOMEM;<br>
 <br>
         smu->od_settings = (void *)od8_settings;<br>
-- <br>
2.20.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></div>
</span></font></div>
</body>
</html>