diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index d15b6e8ac..dc7e8be3a 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c @@ -73,14 +73,14 @@ __must_hold(&cde_app->mutex) trace_gk20a_cde_remove_ctx(cde_ctx); - /* free the channel */ - gk20a_channel_close(ch); - - /* ..then release mapped memory */ + /* release mapped memory */ gk20a_deinit_cde_img(cde_ctx); gk20a_gmmu_unmap(vm, cde_ctx->backing_store_vaddr, g->gr.compbit_store.mem.size, 1); + /* free the channel */ + gk20a_channel_close(ch); + /* housekeeping on app */ list_del(&cde_ctx->list); cde_ctx->g->cde_app.ctx_count--;