aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-08-24 14:24:29 -0400
committerRob Clark <robdclark@gmail.com>2017-10-12 14:19:08 -0400
commit6bd6ae2dfc7e091059fd8a650579bb1efc9b4b9f (patch)
treec95e757facdf8fcbf0a3630b0cf12158b8dacec8
parentdrm/msm/mdp5: Remove extra pm_runtime_put call in mdp5_crtc_cursor_set() (diff)
downloadlinux-dev-6bd6ae2dfc7e091059fd8a650579bb1efc9b4b9f.tar.xz
linux-dev-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>
-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);