summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorManinder Singh <maninder1.s@samsung.com>2015-07-09 14:41:53 +0530
committerOded Gabbay <oded.gabbay@gmail.com>2015-07-09 13:27:52 +0300
commita0f67441b06525a1e5fd713ba0d75af4e5d6b198 (patch)
tree950cc3374a7a15424004737aa30093d6e4407a8d /drivers
parentd770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff)
drm/amdkfd: validate pdd where it acquired firstdrm-amdkfd-fixes-2015-07-09
Currently pdd is validate after dereferencing it, which is not correct, Thus validate pdd before its first use. Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers')
-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);
}