summaryrefslogtreecommitdiff
path: root/ttm
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2013-10-23 03:48:18 -0700
committerThomas Hellstrom <thellstrom@vmware.com>2013-10-24 04:21:02 -0700
commitb1204eea9dffa9731eb57aaea4e3e8a7b254e4a8 (patch)
tree26758fc1785b3b2c29438f137592daec7e2a0e8f /ttm
parentebabde716d0aaf6b01d6dc8454e9a0ada2ffb000 (diff)
ttm: Don't destroy the backend before final clear
Causes a memory leak since we don't get to call DMA unmap Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Diffstat (limited to 'ttm')
-rw-r--r--ttm/ttm_tt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ttm/ttm_tt.c b/ttm/ttm_tt.c
index 99c247c..a6d578d 100644
--- a/ttm/ttm_tt.c
+++ b/ttm/ttm_tt.c
@@ -312,12 +312,6 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
if (unlikely(ttm == NULL))
return;
- be = ttm->be;
- if (likely(be != NULL)) {
- be->func->destroy(be);
- ttm->be = NULL;
- }
-
if (likely(ttm->pages != NULL)) {
if (ttm->page_flags & TTM_PAGE_FLAG_USER)
ttm_tt_free_user_pages(ttm);
@@ -327,6 +321,12 @@ void ttm_tt_destroy(struct ttm_tt *ttm)
ttm_tt_free_page_directory(ttm);
}
+ be = ttm->be;
+ if (likely(be != NULL)) {
+ be->func->destroy(be);
+ ttm->be = NULL;
+ }
+
if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP) &&
ttm->swap_storage)
fput(ttm->swap_storage);