Browse Source

drm/amdgpu: remove redundant memset

kvmalloc_array uses __GFP_ZERO flag ensures that the returned address
is zeroed already, memset it to zero again afterwards is unnecessary,
and in this case buggy because we only clear the first entry.

Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Philip Yang 7 years ago
parent
commit
dcaaff4eed
1 changed files with 0 additions and 1 deletions
  1. 0 1
      drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

+ 0 - 1
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

@@ -541,7 +541,6 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
 						   GFP_KERNEL | __GFP_ZERO);
 						   GFP_KERNEL | __GFP_ZERO);
 		if (!parent->entries)
 		if (!parent->entries)
 			return -ENOMEM;
 			return -ENOMEM;
-		memset(parent->entries, 0 , sizeof(struct amdgpu_vm_pt));
 	}
 	}
 
 
 	from = saddr >> shift;
 	from = saddr >> shift;