diff options
Diffstat (limited to 'meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0557-drm-amdgpu-use-kmemdup-rather-than-duplicating-its-i.patch')
-rw-r--r-- | meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0557-drm-amdgpu-use-kmemdup-rather-than-duplicating-its-i.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0557-drm-amdgpu-use-kmemdup-rather-than-duplicating-its-i.patch b/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0557-drm-amdgpu-use-kmemdup-rather-than-duplicating-its-i.patch new file mode 100644 index 00000000..8ce2b918 --- /dev/null +++ b/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/0557-drm-amdgpu-use-kmemdup-rather-than-duplicating-its-i.patch @@ -0,0 +1,42 @@ +From 71affda522bb0f43e205cf4f000e2c50261c01a6 Mon Sep 17 00:00:00 2001 +From: Andrzej Hajda <a.hajda@samsung.com> +Date: Mon, 21 Sep 2015 17:34:39 -0400 +Subject: [PATCH 0557/1050] drm/amdgpu: use kmemdup rather than duplicating its + implementation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +index f25cfed..1a7708f 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +@@ -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; +-- +1.9.1 + |