diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2016-04-13 07:31:39 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-14 11:43:16 -0400 |
commit | 64339638013d569e725766cc593a1e0ccb802f7f (patch) | |
tree | 79225427dfcd228f0ddcc7327dadd3dcbecff876 /drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | |
parent | f22df728deb90f1c32318dbeaf011389df8ecb59 (diff) |
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 <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/1126138
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_ctx_gk20a.c | 1 |
1 files changed, 1 insertions, 0 deletions
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) | |||
356 | goto done; | 356 | goto done; |
357 | 357 | ||
358 | clean_up: | 358 | clean_up: |
359 | g->gr.ctx_vars.valid = false; | ||
359 | kfree(g->gr.ctx_vars.ucode.fecs.inst.l); | 360 | kfree(g->gr.ctx_vars.ucode.fecs.inst.l); |
360 | kfree(g->gr.ctx_vars.ucode.fecs.data.l); | 361 | kfree(g->gr.ctx_vars.ucode.fecs.data.l); |
361 | kfree(g->gr.ctx_vars.ucode.gpccs.inst.l); | 362 | kfree(g->gr.ctx_vars.ucode.gpccs.inst.l); |