From 40b50c059ae5d50f883386958ad5c2fa1fc30100 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Mon, 29 Oct 2018 15:54:47 -0700 Subject: [PATCH] gpu: nvgpu: Set pd_cache to NULL after it's freed Clear the pointer to the non-existent pd_cache after the pd_cache is freed. This is good practice and makes it easier to verify that this function has accomplished its intended purpose in the unit tests. JIRA NVGPU-1323 Change-Id: I1e1c20344a385bc96b293f2007485e7f4d99f947 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1941535 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-misra-checker Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Scott Long GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/pd_cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/nvgpu/common/mm/pd_cache.c b/drivers/gpu/nvgpu/common/mm/pd_cache.c index 833e02438..80da27499 100644 --- a/drivers/gpu/nvgpu/common/mm/pd_cache.c +++ b/drivers/gpu/nvgpu/common/mm/pd_cache.c @@ -215,6 +215,7 @@ void nvgpu_pd_cache_fini(struct gk20a *g) } nvgpu_kfree(g, g->mm.pd_cache); + g->mm.pd_cache = NULL; } /*