From 64339638013d569e725766cc593a1e0ccb802f7f Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 13 Apr 2016 14:31:39 +0300 Subject: gpu: nvgpu: clean up ctx_vars properly Set ctx_vars.valid to false when removing support. Otherwise a re-poweron sequence could crash when the flag wouldn't match the real state of the driver. Also free all allocated regs instead of leaking some of them. Change-Id: I3fc4fa759d839bc435e53cbd942fa5d39efe7f57 Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/1126138 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c index 64d6542b..a01e43c7 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c @@ -356,6 +356,7 @@ static int gr_gk20a_init_ctx_vars_fw(struct gk20a *g, struct gr_gk20a *gr) goto done; clean_up: + g->gr.ctx_vars.valid = false; kfree(g->gr.ctx_vars.ucode.fecs.inst.l); kfree(g->gr.ctx_vars.ucode.fecs.data.l); kfree(g->gr.ctx_vars.ucode.gpccs.inst.l); -- cgit v1.2.2