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-02-13 14:05:32 +00:00 committed by Andrei Vagin
parent c0002ed839
commit b1281444a8

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;