drm/amdkfd: Use kmemdup instead of duplicating its function
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
651022382c
commit
6dfeb11a4b
@ -753,12 +753,10 @@ int kfd_create_crat_image_acpi(void **crat_image, size_t *size)
|
||||
return -ENODATA;
|
||||
}
|
||||
|
||||
pcrat_image = kmalloc(crat_table->length, GFP_KERNEL);
|
||||
pcrat_image = kmemdup(crat_table, crat_table->length, GFP_KERNEL);
|
||||
if (!pcrat_image)
|
||||
return -ENOMEM;
|
||||
|
||||
memcpy(pcrat_image, crat_table, crat_table->length);
|
||||
|
||||
*crat_image = pcrat_image;
|
||||
*size = crat_table->length;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user