gpu: nvgpu: unit: mm: fix double destroy of mutex

Update mm unit test for nvgpu_mm_remove_support() to avoid calling the
HAL info_mem_destroy() a second time. info_mem_destroy() destroys a
mutex, so if it is called a second time, it will errantly try to destroy
it again.

JIRA NVGPU-4987

Change-Id: I6e384b15955d4059662ded3679293456d9697a0e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2304124
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2020-02-27 14:17:30 -05:00
committed by Alex Waterman
parent ffe44aab13
commit d9c6faa102

View File

@@ -576,6 +576,9 @@ int test_mm_remove_mm_support(struct unit_module *m, struct gk20a *g,
g->ops.mm.remove_bar2_vm = gp10b_mm_remove_bar2_vm;
g->mm.remove_support(&g->mm);
/* Reset this to NULL to avoid trying to destroy the mutex again */
g->ops.mm.mmu_fault.info_mem_destroy = NULL;
/* Extra cases for branch coverage */
nvgpu_set_enabled(g, NVGPU_SUPPORT_SEC2_VM, false);
nvgpu_set_enabled(g, NVGPU_SUPPORT_GSP_VM, false);