diff options
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2702-drm-amdkfd-Use-kmemdup-instead-of-duplicating-its-fu.patch')
-rw-r--r-- | meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2702-drm-amdkfd-Use-kmemdup-instead-of-duplicating-its-fu.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2702-drm-amdkfd-Use-kmemdup-instead-of-duplicating-its-fu.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2702-drm-amdkfd-Use-kmemdup-instead-of-duplicating-its-fu.patch new file mode 100644 index 00000000..d8dfbe30 --- /dev/null +++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2702-drm-amdkfd-Use-kmemdup-instead-of-duplicating-its-fu.patch @@ -0,0 +1,38 @@ +From 8f243c939f7a277c924c1f7b5daac9a615b9c0c3 Mon Sep 17 00:00:00 2001 +From: zhong jiang <zhongjiang@huawei.com> +Date: Tue, 18 Sep 2018 23:35:32 +0800 +Subject: [PATCH 2702/2940] 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> +--- + drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +index 56412b0e7e1c..dd4f3bdbf08c 100644 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +@@ -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; + +-- +2.17.1 + |