diff options
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/vm.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c index 4a7cc828..e6ca38c8 100644 --- a/drivers/gpu/nvgpu/common/mm/vm.c +++ b/drivers/gpu/nvgpu/common/mm/vm.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -339,7 +339,8 @@ int __nvgpu_vm_init(struct mm_gk20a *mm, | |||
339 | #endif | 339 | #endif |
340 | 340 | ||
341 | /* Initialize the page table data structures. */ | 341 | /* Initialize the page table data structures. */ |
342 | strncpy(vm->name, name, min(strlen(name), sizeof(vm->name))); | 342 | strncpy(vm->name, name, sizeof(vm->name)); |
343 | vm->name[sizeof(vm->name) - 1] = '\0'; | ||
343 | err = nvgpu_gmmu_init_page_table(vm); | 344 | err = nvgpu_gmmu_init_page_table(vm); |
344 | if (err) { | 345 | if (err) { |
345 | goto clean_up_vgpu_vm; | 346 | goto clean_up_vgpu_vm; |