The code will either fully populate the allocated array with userspace
provided data, or abort and free the memory, so there is no need to clear
the array before populating it.

Signed-off-by: Tvrtko Ursulin <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
index 87ec46c56a6e..72c5096c3b18 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c
@@ -201,7 +201,6 @@ int amdgpu_bo_create_list_entry_array(struct 
drm_amdgpu_bo_list_in *in,
                if (!info)
                        return -ENOMEM;
 
-               memset(info, 0, bo_number * info_size);
                for (i = 0; i < bo_number; ++i, uptr += bo_info_size) {
                        if (copy_from_user(&info[i], uptr, bytes)) {
                                kvfree(info);
-- 
2.51.1

Reply via email to