aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-07-10 15:56:19 +1000
committerDave Airlie <airlied@redhat.com>2015-07-10 15:56:19 +1000
commit008b3f1f1c3e79c0bff03ca3a0c2dff3d81213c8 (patch)
treeed2748a3ceed076e41c410dbe164ec57c5b7741d
parentMerge branch 'drm-fixes-4.2' of git://people.freedesktop.org/~agd5f/linux into drm-fixes (diff)
parentdrm/amdkfd: validate pdd where it acquired first (diff)
downloadlinux-dev-008b3f1f1c3e79c0bff03ca3a0c2dff3d81213c8.tar.xz
linux-dev-008b3f1f1c3e79c0bff03ca3a0c2dff3d81213c8.zip
Merge tag 'drm-amdkfd-fixes-2015-07-09' of git://people.freedesktop.org/~gabbayo/linux into drm-fixes
A single fix so far for 4.2: - checking a pointer is not null before using it * tag 'drm-amdkfd-fixes-2015-07-09' of git://people.freedesktop.org/~gabbayo/linux: drm/amdkfd: validate pdd where it acquired first
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_process.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 8a1f999daa24..9be007081b72 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -420,6 +420,12 @@ void kfd_unbind_process_from_device(struct kfd_dev *dev, unsigned int pasid)
pqm_uninit(&p->pqm);
pdd = kfd_get_process_device_data(dev, p);
+
+ if (!pdd) {
+ mutex_unlock(&p->mutex);
+ return;
+ }
+
if (pdd->reset_wavefronts) {
dbgdev_wave_reset_wavefronts(pdd->dev, p);
pdd->reset_wavefronts = false;
@@ -431,8 +437,7 @@ void kfd_unbind_process_from_device(struct kfd_dev *dev, unsigned int pasid)
* We don't call amd_iommu_unbind_pasid() here
* because the IOMMU called us.
*/
- if (pdd)
- pdd->bound = false;
+ pdd->bound = false;
mutex_unlock(&p->mutex);
}