summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-08-24 20:24:29 +0200
committerRob Clark <robdclark@gmail.com>2017-10-12 20:19:08 +0200
commit6bd6ae2dfc7e091059fd8a650579bb1efc9b4b9f (patch)
treec95e757facdf8fcbf0a3630b0cf12158b8dacec8 /drivers/gpu
parentdrm/msm/mdp5: Remove extra pm_runtime_put call in mdp5_crtc_cursor_set() (diff)
downloadlinux-6bd6ae2dfc7e091059fd8a650579bb1efc9b4b9f.tar.xz
linux-6bd6ae2dfc7e091059fd8a650579bb1efc9b4b9f.zip
drm/msm: fix error path cleanup
If we fail to attach iommu, gpu->aspace could be IS_ERR().. Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index ffbff27600e0..6a887032c66a 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -718,7 +718,8 @@ void msm_gpu_cleanup(struct msm_gpu *gpu)
msm_gem_put_iova(gpu->rb->bo, gpu->aspace);
msm_ringbuffer_destroy(gpu->rb);
}
- if (gpu->aspace) {
+
+ if (!IS_ERR_OR_NULL(gpu->aspace)) {
gpu->aspace->mmu->funcs->detach(gpu->aspace->mmu,
NULL, 0);
msm_gem_address_space_put(gpu->aspace);