]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdkfd: fix sysfs topology prop length on buffer truncation
authorYongqiang Sun <Yongqiang.Sun@amd.com>
Mon, 1 Jun 2026 19:48:44 +0000 (15:48 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 4 Jun 2026 19:27:37 +0000 (15:27 -0400)
commit8bfd3aeeb7d4c140434bb9e604fca39ebb3e2937
tree81a93f4485d00a1333246b23bc24e68e91038f21
parent342981fff32802a819d6fc7cf3c9fedf9f3d9d60
drm/amdkfd: fix sysfs topology prop length on buffer truncation

sysfs_show_gen_prop() accumulated snprintf()'s return value into the
offset. snprintf() reports bytes that would have been written, not
bytes actually written, so a truncated sysfs show could over-report
its length. Use sysfs_emit_at(), which returns only the bytes written.

Signed-off-by: Yongqiang Sun <Yongqiang.Sun@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c