summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2018-10-10 16:04:31 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2018-11-29 10:48:12 +0100
commit75d2637cbec81401d37305767939d53d9f409559 (patch)
treedd61beb978557eba1c0235447473ea0a624604bd /drivers/gpu
parenta05b96fea9971f3648b53824d97ccddb1a197267 (diff)
Tegra: fix potential one byte overflows when calling strncpy()
Causes build failures with gcc 8. Signed-off-by: Rolf Eike Beer <eb@emlix.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c
index 32c003b655a6..422670d43397 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator.c
@@ -842,9 +842,9 @@ gk20a_allocator_constrain(struct gk20a_allocator *a,
int gk20a_allocator_init(struct gk20a_allocator *allocator,
const char *name, u32 start, u32 len, u32 align)
{
- memset(allocator, 0, sizeof(struct gk20a_allocator));
+ memset(allocator, 0, sizeof(*allocator));
- strncpy(allocator->name, name, 32);
+ strlcpy(allocator->name, name, sizeof(allocator->name));
allocator->block_cache =
kmem_cache_create(allocator->name,