diff options
| author | Mirsad Todorovac <[email protected]> | 2024-12-17 22:58:10 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-12-18 17:39:08 +0000 |
| commit | a21ab06b8c2d8d25c4a83bdf39542834b1f3beae (patch) | |
| tree | 64bc12279eb2aeee83e04611960514b7049e405c /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |
| parent | drm/amd/display: Fix NULL pointer dereference in dmub_tracebuffer_show (diff) | |
| download | kernel-a21ab06b8c2d8d25c4a83bdf39542834b1f3beae.tar.gz kernel-a21ab06b8c2d8d25c4a83bdf39542834b1f3beae.zip | |
drm/admgpu: replace kmalloc() and memcpy() with kmemdup()
The static analyser tool gave the following advice:
./drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c:1266:7-14: WARNING opportunity for kmemdup
→ 1266 tmp = kmalloc(used_size, GFP_KERNEL);
1267 if (!tmp)
1268 return -ENOMEM;
1269
→ 1270 memcpy(tmp, &host_telemetry->body.error_count, used_size);
Replacing kmalloc() + memcpy() with kmemdump() doesn't change semantics.
Original code works without fault, so this is not a bug fix but proposed improvement.
Link: https://lwn.net/Articles/198928/
Fixes: 84a2947ecc85 ("drm/amdgpu: Implement virt req_ras_err_count")
Cc: Alex Deucher <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: Xinhui Pan <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Simona Vetter <[email protected]>
Cc: Zhigang Luo <[email protected]>
Cc: Victor Skvortsov <[email protected]>
Cc: Hawking Zhang <[email protected]>
Cc: Lijo Lazar <[email protected]>
Cc: Yunxiang Li <[email protected]>
Cc: Jack Xiao <[email protected]>
Cc: Vignesh Chander <[email protected]>
Cc: Danijel Slivka <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Lijo Lazar <[email protected]>
Signed-off-by: Mirsad Todorovac <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
0 files changed, 0 insertions, 0 deletions
