gpu: nvgpu: fix resource leaks when cleaning up

In channel_free(), destroy notifier_wq and
semaphore_wq

In nvgpu_vm_remove(), destroy the update_gmmu_lock mutex

Bug 200647668

Change-Id: Icbb4e626c0fa9fa2dcf1430b3112b51829b00e4f
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2414820
(cherry picked from commit 4f66942afa)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2416311
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Alex Waterman <alexw@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:
Peter Daifuku
2020-09-16 13:50:29 -07:00
committed by Alex Waterman
parent b49c892f81
commit a6e5c54882
2 changed files with 4 additions and 0 deletions

View File

@@ -1031,6 +1031,9 @@ unbind:
ch->ref_actions_put = 0;
#endif
nvgpu_cond_destroy(&ch->notifier_wq);
nvgpu_cond_destroy(&ch->semaphore_wq);
/* make sure we catch accesses of unopened channels in case
* there's non-refcounted channel pointers hanging around */
ch->g = NULL;

View File

@@ -994,6 +994,7 @@ static void nvgpu_vm_remove(struct vm_gk20a *vm)
}
nvgpu_mutex_release(&vm->update_gmmu_lock);
nvgpu_mutex_destroy(&vm->update_gmmu_lock);
nvgpu_mutex_destroy(&vm->syncpt_ro_map_lock);
nvgpu_kfree(g, vm);