Re: [PATCH libdrm V2] amdgpu: Fix a structure initialization issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

From: Pan, Xinhui
Sent: Friday, April 12, 2019 1:42 AM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Deucher, Alexander
Subject: [PATCH libdrm V2] amdgpu: Fix a structure initialization issue
 
struct drmPciBusInfo has been aligned to 6 bytes. So memcmp will access
the last byte which is not initialized.

Signed-off-by: xinhui pan <xinhui.pan@xxxxxxx>
---
 tests/amdgpu/ras_tests.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/amdgpu/ras_tests.c b/tests/amdgpu/ras_tests.c
index 612ad1d7..81c34ad6 100644
--- a/tests/amdgpu/ras_tests.c
+++ b/tests/amdgpu/ras_tests.c
@@ -196,6 +196,7 @@ static int amdgpu_ras_lookup_id(drmDevicePtr device)
 
         for (i = 0; i < MAX_CARDS_SUPPORTED; i++) {
                 memset(str, 0, sizeof(str));
+               memset(&info, 0, sizeof(info));
                 sprintf(path, "/sys/kernel/debug/dri/%d/name", i);
                 if (get_file_contents(path, str, sizeof(str)) <= 0)
                         continue;
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux