summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_ringbuffer.c
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2017-06-12 09:16:48 -0600
committerJordan Crouse <jcrouse@codeaurora.org>2017-06-19 15:50:32 -0600
commit53530e16447303d6e4ff4372be5bfe9922261596 (patch)
treecc975a56462e38a04a1086e708ee0039bc5418b7 /drivers/gpu/drm/msm/msm_ringbuffer.c
parentd8505d8307d73749b9eb0ff01c978a6ba0c60928 (diff)
drm/msm: Simplify ringbuffer cleanup
Cleanup and consolidate sanity checking on the ringbuffer cleanup code. Change-Id: Ic0dedbad551d36ca8ed3db56a4366a5008768791 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/msm/msm_ringbuffer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c b/drivers/gpu/drm/msm/msm_ringbuffer.c
index 458f80426b39..9b8e76da449f 100644
--- a/drivers/gpu/drm/msm/msm_ringbuffer.c
+++ b/drivers/gpu/drm/msm/msm_ringbuffer.c
@@ -60,7 +60,10 @@ fail:
void msm_ringbuffer_destroy(struct msm_ringbuffer *ring)
{
- if (ring->bo)
+ if (ring && ring->bo) {
+ msm_gem_put_iova(ring->bo, ring->gpu->aspace);
drm_gem_object_unreference_unlocked(ring->bo);
+ }
+
kfree(ring);
}