From 98e87ca10ce780ee33fd7b61679536156cf637ea Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 15 Feb 2018 12:47:13 -0800 Subject: gpu: nvgpu: POSIX does not have a strlcpy So don't use it in common code. This could be implemented in common code but it would just be a wrapper around strncpy() most likely since we aren't going to maintain low level (possibly asm) implementations of APIs. NVGPU-525 Signed-off-by: Alex Waterman Change-Id: If446589cd1736456184daa75ae539c4ce332b741 Reviewed-on: https://git-master.nvidia.com/r/1658300 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c b/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c index 7a4e7705..c749c729 100644 --- a/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c @@ -156,7 +156,8 @@ int __nvgpu_alloc_common_init(struct nvgpu_allocator *a, struct gk20a *g, a->priv = priv; a->debug = dbg; - strlcpy(a->name, name, sizeof(a->name)); + strncpy(a->name, name, sizeof(a->name)); + a->name[sizeof(a->name) - 1] = 0; return 0; } -- cgit v1.2.2