mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 09:41:03 +02:00
drm/amdgpu: initialize iter.start in amdgpu_devcoredump_format
This fixes read /sys/class/drm/cardN/device/devcoredump/data
return empty content sometimes.
amdgpu_devcoredump_format() leaves struct drm_print_iterator's
.start field uninitialized on the stack before passing it to
drm_coredump_printer(). __drm_puts_coredump() compares the running
.offset against .start to decide whether to skip or copy each
chunk:
if (iterator->offset < iterator->start) {
if (iterator->offset + len <= iterator->start) {
iterator->offset += len;
return;
}
...
}
Fixes: 4bbba79a7f ("drm/amdgpu: move devcoredump generation to a worker")
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Qiang Yu <Qiang.Yu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
927c5b2def
commit
cd6397b7af
|
|
@ -229,6 +229,7 @@ amdgpu_devcoredump_format(char *buffer, size_t count, struct amdgpu_coredump_inf
|
|||
|
||||
sizing_pass = buffer == NULL;
|
||||
iter.data = buffer;
|
||||
iter.start = 0;
|
||||
iter.offset = 0;
|
||||
iter.remain = count;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user