mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
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
This commit is contained in:
@@ -2135,7 +2135,7 @@ int gk20a_init_gpu_characteristics(struct gk20a *g)
|
||||
gpu->as_ioctl_nr_last = NVGPU_AS_IOCTL_LAST;
|
||||
gpu->gpu_va_bit_count = 40;
|
||||
|
||||
memcpy(gpu->chipname, g->ops.name, strlen(g->ops.name));
|
||||
strlcpy(gpu->chipname, g->ops.name, sizeof(gpu->chipname));
|
||||
gpu->max_fbps_count = g->ops.gr.get_max_fbps_count(g);
|
||||
gpu->fbp_en_mask = g->ops.gr.get_fbp_en_mask(g);
|
||||
gpu->max_ltc_per_fbp = g->ops.gr.get_max_ltc_per_fbp(g);
|
||||
|
||||
Reference in New Issue
Block a user