gpu: nvgpu: Fix CERT-C Violations

Fix the following CERT-C Violations:
gsp_runlist.c : CERT EXP34-C
channel_sync_syncpt.c : CERT ERR33-C
grmgr_ga100.c : CERT ERR33-C
grmgr_ga10b.c : CERT ERR33-C
debug.c : CERT ERR33-C
debug_fecs_trace.c : CERT EXP34-C
ioctl.c : CERT ERR33-C

CID 495110
CID 141061
CID 222881
CID 222890
CID 450994
CID 366644
CID 466529

Bug 3512546

Signed-off-by: Jinesh Parakh <jparakh@nvidia.com>
Change-Id: I318a27a6fcb8ea8f6d5d6c1f65d940c48d6f8dfc
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2723008
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Jinesh Parakh
2022-06-01 12:03:08 +05:30
committed by mobile promotions
parent dcec7f184e
commit b8b90f85ee
7 changed files with 24 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
/*
* GA100 GR MANAGER
*
* Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2020-2022, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1097,9 +1097,11 @@ const struct nvgpu_mig_gpu_instance_config *ga100_grmgr_get_mig_config_ptr(
u32 start_id_of_half_partition = 0x1;
gpu_instance_config =
&ga100_gpu_instance_default_config.gpu_instance_config[num_config];
snprintf(gpu_instance_config->config_name,
err = snprintf(gpu_instance_config->config_name,
NVGPU_MIG_MAX_CONFIG_NAME_SIZE,
"2 GPU instances each with %u GPCs", gpc_count_per_gpu_instance);
nvgpu_assert(err > 0);
gpu_instance_config->num_gpu_instances = 2U;
for (index = 0U; index < 2U; index++) {