<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 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> Pan, Xinhui<br>
<b>Sent:</b> Friday, April 12, 2019 1:42 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Deucher, Alexander<br>
<b>Subject:</b> [PATCH libdrm V2] amdgpu: Fix a structure initialization issue</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">struct drmPciBusInfo has been aligned to 6 bytes. So memcmp will access<br>
the last byte which is not initialized.<br>
<br>
Signed-off-by: xinhui pan <xinhui.pan@amd.com><br>
---<br>
tests/amdgpu/ras_tests.c | 1 +<br>
1 file changed, 1 insertion(+)<br>
<br>
diff --git a/tests/amdgpu/ras_tests.c b/tests/amdgpu/ras_tests.c<br>
index 612ad1d7..81c34ad6 100644<br>
--- a/tests/amdgpu/ras_tests.c<br>
+++ b/tests/amdgpu/ras_tests.c<br>
@@ -196,6 +196,7 @@ static int amdgpu_ras_lookup_id(drmDevicePtr device)<br>
<br>
for (i = 0; i < MAX_CARDS_SUPPORTED; i++) {<br>
memset(str, 0, sizeof(str));<br>
+ memset(&info, 0, sizeof(info));<br>
sprintf(path, "/sys/kernel/debug/dri/%d/name", i);<br>
if (get_file_contents(path, str, sizeof(str)) <= 0)<br>
continue;<br>
-- <br>
2.17.1<br>
<br>
</div>
</span></font></div>
</body>
</html>