mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2026-05-05 13:38:04 +02:00
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. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: xinhui pan <xinhui.pan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
210bfdf8f8
commit
fcf80e2fd7
1 changed files with 1 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue