diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-06-27 15:48:33 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-07-07 07:13:38 -0400 |
commit | 6a7b85527e96f64e913137d79b66c90ff62124fe (patch) | |
tree | da137218e732da4062b78beb965b3d6a1dee11ab /drivers | |
parent | 1b04326f400489f25399167ef9f1c931a576656e (diff) |
gpu: nvgpu: Add check for chip name size
When copying chip name to GPU characteristics limit the size of copy
to the size of target name field.
Coverity ID 33613
Change-Id: Ia538d47b9d5e1dd122d57ccd8bfbb3902612874c
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1172007
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 44ed4e51..2ca89e9f 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -2135,7 +2135,7 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) | |||
2135 | gpu->as_ioctl_nr_last = NVGPU_AS_IOCTL_LAST; | 2135 | gpu->as_ioctl_nr_last = NVGPU_AS_IOCTL_LAST; |
2136 | gpu->gpu_va_bit_count = 40; | 2136 | gpu->gpu_va_bit_count = 40; |
2137 | 2137 | ||
2138 | memcpy(gpu->chipname, g->ops.name, strlen(g->ops.name)); | 2138 | strlcpy(gpu->chipname, g->ops.name, sizeof(gpu->chipname)); |
2139 | gpu->max_fbps_count = g->ops.gr.get_max_fbps_count(g); | 2139 | gpu->max_fbps_count = g->ops.gr.get_max_fbps_count(g); |
2140 | gpu->fbp_en_mask = g->ops.gr.get_fbp_en_mask(g); | 2140 | gpu->fbp_en_mask = g->ops.gr.get_fbp_en_mask(g); |
2141 | gpu->max_ltc_per_fbp = g->ops.gr.get_max_ltc_per_fbp(g); | 2141 | gpu->max_ltc_per_fbp = g->ops.gr.get_max_ltc_per_fbp(g); |