mirror of
https://github.com/torvalds/linux.git
synced 2024-12-12 06:02:38 +00:00
drm/amdgpu: use kmemdup rather than duplicating its implementation
The patch was generated using fixed coccinelle semantic patch scripts/coccinelle/api/memdup.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2014320 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
1f4452105c
commit
71affda522
@ -536,12 +536,10 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata,
|
||||
if (metadata == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
buffer = kzalloc(metadata_size, GFP_KERNEL);
|
||||
buffer = kmemdup(metadata, metadata_size, GFP_KERNEL);
|
||||
if (buffer == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
memcpy(buffer, metadata, metadata_size);
|
||||
|
||||
kfree(bo->metadata);
|
||||
bo->metadata_flags = flags;
|
||||
bo->metadata = buffer;
|
||||
|
Loading…
Reference in New Issue
Block a user