diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2020-09-16 16:50:29 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2020-09-18 10:09:09 -0400 |
commit | 4f66942afaaae2fcfedec2bf351664ac3b656238 (patch) | |
tree | eff60d1a658c1d7d09f4e3f1c04a2514c6b0488e /drivers/gpu/nvgpu | |
parent | 036e000a17425e0569990f2aacae91b273392153 (diff) |
nvgpu: fix resource leaks when cleaning up
In gk20a_free_channel, 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
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Shashank Singh <shashsingh@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Satish Arora <satisha@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/fifo/channel.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/vm.c | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c index 0f4fe850..7179d46e 100644 --- a/drivers/gpu/nvgpu/common/fifo/channel.c +++ b/drivers/gpu/nvgpu/common/fifo/channel.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GK20A Graphics channel | 2 | * GK20A Graphics channel |
3 | * | 3 | * |
4 | * Copyright (c) 2011-2019, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2011-2020, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * Permission is hereby granted, free of charge, to any person obtaining a | 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
7 | * copy of this software and associated documentation files (the "Software"), | 7 | * copy of this software and associated documentation files (the "Software"), |
@@ -512,6 +512,9 @@ unbind: | |||
512 | ch->ref_actions_put = 0; | 512 | ch->ref_actions_put = 0; |
513 | #endif | 513 | #endif |
514 | 514 | ||
515 | nvgpu_cond_destroy(&ch->notifier_wq); | ||
516 | nvgpu_cond_destroy(&ch->semaphore_wq); | ||
517 | |||
515 | /* make sure we catch accesses of unopened channels in case | 518 | /* make sure we catch accesses of unopened channels in case |
516 | * there's non-refcounted channel pointers hanging around */ | 519 | * there's non-refcounted channel pointers hanging around */ |
517 | ch->g = NULL; | 520 | ch->g = NULL; |
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c index e6ca38c8..2464a3bf 100644 --- a/drivers/gpu/nvgpu/common/mm/vm.c +++ b/drivers/gpu/nvgpu/common/mm/vm.c | |||
@@ -658,6 +658,7 @@ static void __nvgpu_vm_remove(struct vm_gk20a *vm) | |||
658 | #endif | 658 | #endif |
659 | 659 | ||
660 | nvgpu_mutex_release(&vm->update_gmmu_lock); | 660 | nvgpu_mutex_release(&vm->update_gmmu_lock); |
661 | nvgpu_mutex_destroy(&vm->update_gmmu_lock); | ||
661 | 662 | ||
662 | nvgpu_mutex_destroy(&vm->syncpt_ro_map_lock); | 663 | nvgpu_mutex_destroy(&vm->syncpt_ro_map_lock); |
663 | nvgpu_kfree(g, vm); | 664 | nvgpu_kfree(g, vm); |