diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c index 7f0b3d104..4e221500a 100644 --- a/drivers/gpu/nvgpu/common/mm/vm.c +++ b/drivers/gpu/nvgpu/common/mm/vm.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -873,12 +873,13 @@ struct nvgpu_mapped_buf *nvgpu_vm_map(struct vm_gk20a *vm, map_addr, flags, map_key_kind); - nvgpu_mutex_release(&vm->update_gmmu_lock); if (mapped_buffer) { nvgpu_ref_get(&mapped_buffer->ref); + nvgpu_mutex_release(&vm->update_gmmu_lock); return mapped_buffer; } + nvgpu_mutex_release(&vm->update_gmmu_lock); } /*