Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdkfd: Fix improper NULL termination of queue restore SMI event string

Pass character "0" rather than NULL terminator to properly format
queue restoration SMI events. Currently, the NULL terminator precedes
the newline character that is intended to delineate separate events
in the SMI event buffer, which can break userspace parsers.

Signed-off-by: Brian Kocoloski <brian.kocoloski@amd.com>
Reviewed-by: Philip Yang <Philip.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 6e7143e5e6e21f9d5572e0390f7089e6d53edf3c)

authored by

Brian Kocoloski and committed by
Alex Deucher
969faea4 7a372e21

+1 -1
+1 -1
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
··· 312 312 { 313 313 kfd_smi_event_add(pid, node, KFD_SMI_EVENT_QUEUE_RESTORE, 314 314 KFD_EVENT_FMT_QUEUE_RESTORE(ktime_get_boottime_ns(), pid, 315 - node->id, 0)); 315 + node->id, '0')); 316 316 } 317 317 318 318 void kfd_smi_event_queue_restore_rescheduled(struct mm_struct *mm)