diff options
author | Dave Airlie <airlied@redhat.com> | 2015-07-10 01:56:19 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-07-10 01:56:19 -0400 |
commit | 008b3f1f1c3e79c0bff03ca3a0c2dff3d81213c8 (patch) | |
tree | ed2748a3ceed076e41c410dbe164ec57c5b7741d | |
parent | 9d5715f9de2e72ee828c38eae44b08ee24b408ed (diff) | |
parent | a0f67441b06525a1e5fd713ba0d75af4e5d6b198 (diff) |
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.c | 9 |
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) | |||
420 | pqm_uninit(&p->pqm); | 420 | pqm_uninit(&p->pqm); |
421 | 421 | ||
422 | pdd = kfd_get_process_device_data(dev, p); | 422 | pdd = kfd_get_process_device_data(dev, p); |
423 | |||
424 | if (!pdd) { | ||
425 | mutex_unlock(&p->mutex); | ||
426 | return; | ||
427 | } | ||
428 | |||
423 | if (pdd->reset_wavefronts) { | 429 | if (pdd->reset_wavefronts) { |
424 | dbgdev_wave_reset_wavefronts(pdd->dev, p); | 430 | dbgdev_wave_reset_wavefronts(pdd->dev, p); |
425 | pdd->reset_wavefronts = false; | 431 | pdd->reset_wavefronts = false; |
@@ -431,8 +437,7 @@ void kfd_unbind_process_from_device(struct kfd_dev *dev, unsigned int pasid) | |||
431 | * We don't call amd_iommu_unbind_pasid() here | 437 | * We don't call amd_iommu_unbind_pasid() here |
432 | * because the IOMMU called us. | 438 | * because the IOMMU called us. |
433 | */ | 439 | */ |
434 | if (pdd) | 440 | pdd->bound = false; |
435 | pdd->bound = false; | ||
436 | 441 | ||
437 | mutex_unlock(&p->mutex); | 442 | mutex_unlock(&p->mutex); |
438 | } | 443 | } |