aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3828-drm-amdgpu-Fix-kernel-NULL-pointer-dereference-when-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3828-drm-amdgpu-Fix-kernel-NULL-pointer-dereference-when-.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3828-drm-amdgpu-Fix-kernel-NULL-pointer-dereference-when-.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3828-drm-amdgpu-Fix-kernel-NULL-pointer-dereference-when-.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3828-drm-amdgpu-Fix-kernel-NULL-pointer-dereference-when-.patch
new file mode 100644
index 00000000..7db7f41f
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3828-drm-amdgpu-Fix-kernel-NULL-pointer-dereference-when-.patch
@@ -0,0 +1,43 @@
+From 36a2657205e3c216869c05fb475de3191719102d Mon Sep 17 00:00:00 2001
+From: Rex Zhu <Rex.Zhu@amd.com>
+Date: Tue, 20 Mar 2018 16:28:56 +0800
+Subject: [PATCH 3828/4131] drm/amdgpu: Fix kernel NULL pointer dereference
+ when amdgpu fini
+
+Change-Id: I002dfb327c895efa12d460c4dbb3b1ad0f389d12
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++-
+ drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+index 8ce6354..5026ff0 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+@@ -1537,7 +1537,8 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev)
+ continue;
+
+ if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
+- adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE) {
++ adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE &&
++ adev->ip_blocks[i].version->funcs->set_clockgating_state) {
+ /* ungate blocks before hw fini so that we can shutdown the blocks safely */
+ r = adev->ip_blocks[i].version->funcs->set_clockgating_state((void *)adev,
+ AMD_CG_STATE_UNGATE);
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+index 5ed88ed..282cf62 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+@@ -260,6 +260,7 @@ void amdgpu_irq_fini(struct amdgpu_device *adev)
+ }
+ }
+ kfree(adev->irq.client[i].sources);
++ adev->irq.client[i].sources = NULL;
+ }
+ }
+
+--
+2.7.4
+