diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2013-10-23 03:48:18 -0700 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2013-10-24 04:21:02 -0700 |
commit | b1204eea9dffa9731eb57aaea4e3e8a7b254e4a8 (patch) | |
tree | 26758fc1785b3b2c29438f137592daec7e2a0e8f /ttm | |
parent | ebabde716d0aaf6b01d6dc8454e9a0ada2ffb000 (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.c | 12 |
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); |