gpu: nvgpu: compile out unused code in gr init unit

Add CONFIG_NVGPU_GRAPHICS check before calling
g->gops>gr.init.preemption_state function.

Add NULL checking of pointer before deferecing those
pointers in de_init functions

Jira NVGPU-4676

Change-Id: Id9be0aebdcab4a8fb2b03e92e67c1c207b5b8eab
Signed-off-by: vinodg <vinodg@nvidia.com>
Reviewed-on: http://git-master.nvidia.com/r/c/linux-nvgpu/+/2276898
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
vinodg
2020-01-08 13:34:33 -08:00
committed by Alex Waterman
parent d864904a49
commit a126e00e28
5 changed files with 18 additions and 0 deletions

View File

@@ -610,6 +610,10 @@ void nvgpu_netlist_deinit_ctx_vars(struct gk20a *g)
{
struct nvgpu_netlist_vars *netlist_vars = g->netlist_vars;
if (netlist_vars == NULL) {
return;
}
g->netlist_valid = false;
nvgpu_kfree(g, netlist_vars->ucode.fecs.inst.l);
nvgpu_kfree(g, netlist_vars->ucode.fecs.data.l);