ac/gpu_info: don't read uninitialized dev_filename

This fixes radeonsi-run-tests.py not being able to read AMD_DEBUG=info.

Fixes: 8777894d3e - amd: remove radeon_info::dev_filename

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39145>
This commit is contained in:
Marek Olšák 2026-01-03 18:53:09 -05:00 committed by Marge Bot
parent 86b74563a0
commit b340588119

View file

@ -1712,9 +1712,9 @@ void ac_print_gpu_info(FILE *f, const struct radeon_info *info, int fd)
fprintf(f, " marketing_name = %s\n", info->marketing_name);
char proc_fd[32];
char dev_filename[32];
char dev_filename[32] = {0};
snprintf(proc_fd, sizeof(proc_fd), "/proc/self/fd/%u", fd);
if (readlink(proc_fd, dev_filename, sizeof(dev_filename)) != -1)
if (readlink(proc_fd, dev_filename, sizeof(dev_filename) - 1) != -1)
fprintf(f, " dev_filename = %s\n", dev_filename);
fprintf(f, " num_se = %i\n", info->num_se);