diff options
| author | Chen Li <[email protected]> | 2021-03-17 14:48:29 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2021-03-24 03:36:40 +0000 |
| commit | 0303e1b77c4db2fd11e9005836f1baaa0ffacb7b (patch) | |
| tree | 495f1af3a1995c92b3e0b90c1ce7007d47288a1d /drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | |
| parent | drm/amdgpu: drop extraneous hw_status update (diff) | |
| download | kernel-0303e1b77c4db2fd11e9005836f1baaa0ffacb7b.tar.gz kernel-0303e1b77c4db2fd11e9005836f1baaa0ffacb7b.zip | |
radeon: use kvcalloc for relocs and chunks
kvmalloc_array + __GFP_ZERO is the same with kvcalloc.
As for p->chunks, it will be used in:
```
if (ib_chunk->kdata)
memcpy(parser->ib.ptr, ib_chunk->kdata, ib_chunk->length_dw * 4);
```
If chunks doesn't zero out with __GFP_ZERO, it may point to somewhere else, e.g.,
```
Unable to handle kernel paging request at virtual address 0000000000010000
...
pc is at memcpy+0x84/0x250
ra is at radeon_cs_ioctl+0x368/0xb90 [radeon]
```
after allocating chunks with __GFP_KERNEL/kvcalloc, this bug is fixed.
Fixes: 3fcb4f01deed ("drm/radeon: Use kvmalloc for CS chunks")
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Chen Li <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c')
0 files changed, 0 insertions, 0 deletions
