plugins/amdgpu: Fix drm pages size header

Size needs to be initialized before opening the file for write, otherwise
garbage is written into the file.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-By: David Francis <David.Francis@amd.com>
This commit is contained in:
Tvrtko Ursulin 2026-04-10 19:54:55 +01:00 committed by Andrei Vagin
parent b9f7062be8
commit 366eea16ec

View file

@ -414,6 +414,7 @@ int amdgpu_plugin_drm_dump_file(int fd, int id, struct stat *drm)
}
snprintf(img_path, sizeof(img_path), IMG_DRM_PAGES_FILE, rd->id, rd->drm_render_minor, i);
image_size = handle_entry.size;
bo_contents_fp = open_img_file(img_path, true, &image_size, true);
if (!bo_contents_fp) {
ret = -errno;