gpu: nvgpu: Clear dangling pointer in pd_cache

This A) clears a dangling pointer which should make the code
more robust, and B) allows for easier unit testing of the
nvgpu_pd_cache_do_free() functions since there's now a
tangible change to the nvgpu_gmmu_pd after this function runs.

JIRA NVGPU-1323

Change-Id: I57db02c9e74324b8e3c3fd4a2c14565dfd0048aa
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1949936
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2018-11-13 12:12:15 -08:00
committed by mobile promotions
parent 3f7b312e89
commit 5dd5c0aa94

View File

@@ -491,6 +491,8 @@ static void nvgpu_pd_cache_do_free(struct gk20a *g,
/* Empty now so free it. */
nvgpu_pd_cache_free_mem_entry(g, cache, pentry);
}
pd->mem = NULL;
}
static struct nvgpu_pd_mem_entry *nvgpu_pd_cache_look_up(