From 0f73de00cb481b11a26b42fa7aa87dde8501f6b2 Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Tue, 5 May 2026 10:18:59 +0100 Subject: [PATCH] plugins/amdgpu: Use existing temporary buffer for the buffer object image name amdgpu_plugin_drm_dump_file() already defines a large temporary stack buffer for the purpose of generating the file level protobuf image name. Instead of the buffer object dumping loop defining a separate temporary stack buffer for the buffer content protobuf images we can simply use the top level one. Signed-off-by: Tvrtko Ursulin --- plugins/amdgpu/amdgpu_plugin_drm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/amdgpu/amdgpu_plugin_drm.c b/plugins/amdgpu/amdgpu_plugin_drm.c index dd9d3a594..4143763d7 100644 --- a/plugins/amdgpu/amdgpu_plugin_drm.c +++ b/plugins/amdgpu/amdgpu_plugin_drm.c @@ -306,7 +306,6 @@ int amdgpu_plugin_drm_dump_file(int fd, int id, struct stat *drm) uint32_t major, minor; amdgpu_device_handle h_dev; void *buffer = NULL; - char img_path[40]; int device_fd; boinfo->size = entry->size; @@ -393,9 +392,9 @@ int amdgpu_plugin_drm_dump_file(int fd, int id, struct stat *drm) goto exit; } - snprintf(img_path, sizeof(img_path), IMG_DRM_PAGES_FILE, rd->id, rd->drm_render_minor, i); + snprintf(path, sizeof(path), IMG_DRM_PAGES_FILE, rd->id, rd->drm_render_minor, i); image_size = entry->size; - bo_contents_fd = open_img_file(img_path, true, &image_size, true); + bo_contents_fd = open_img_file(path, true, &image_size, true); if (bo_contents_fd < 0) { ret = bo_contents_fd; close(dmabuf_fd);