summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_gem.c
diff options
context:
space:
mode:
authorBrian Masney <masneyb@onstation.org>2019-06-03 04:01:31 +0300
committerRob Clark <robdclark@chromium.org>2019-06-19 00:03:16 +0300
commitd67f1b6d0e0be8240186e3cc998353e52ed6ea31 (patch)
treef586bef4a5373687d26f5e579fe499b1aa19ebd9 /drivers/gpu/drm/msm/msm_gem.c
parent61f0479757aa4371801b9d552e85dd6d6327d036 (diff)
downloadlinux-d67f1b6d0e0be8240186e3cc998353e52ed6ea31.tar.xz
drm/msm: correct attempted NULL pointer dereference in put_iova
put_iova() would attempt to dereference a NULL pointer via the address space pointer when no IOMMU is present. Correct this by adding the appropriate check. Signed-off-by: Brian Masney <masneyb@onstation.org> Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gem.c')
-rw-r--r--drivers/gpu/drm/msm/msm_gem.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c
index 35f55dd25994..d31d9f927887 100644
--- a/drivers/gpu/drm/msm/msm_gem.c
+++ b/drivers/gpu/drm/msm/msm_gem.c
@@ -352,8 +352,10 @@ put_iova(struct drm_gem_object *obj)
WARN_ON(!mutex_is_locked(&msm_obj->lock));
list_for_each_entry_safe(vma, tmp, &msm_obj->vmas, list) {
- msm_gem_purge_vma(vma->aspace, vma);
- msm_gem_close_vma(vma->aspace, vma);
+ if (vma->aspace) {
+ msm_gem_purge_vma(vma->aspace, vma);
+ msm_gem_close_vma(vma->aspace, vma);
+ }
del_vma(vma);
}
}