DCE_KMD: Fix TOP 25 CWE Rule

- This patch fixes the following violations

  OVERRUN - 1 (24138320)
  - Added checks to validate boundries

  Rule: OVERRUN
  Rule Description: Out-of-bounds access to a buffer

JIRA TDS-15862

Change-Id: I4df6c7124da19143eb0d9b8027df28fccdff0b75
Signed-off-by: saranyad <saranyad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305934
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
saranyad
2025-02-19 09:33:26 +00:00
committed by Jon Hunter
parent 4dce44a907
commit d0e719df4a

View File

@@ -318,7 +318,7 @@ int dce_client_init(struct tegra_dce *d)
} }
fail_work_init: fail_work_init:
if (ret) { if (ret && (i > 0)) {
uint8_t j = 0; uint8_t j = 0;
for (j = i - 1; j >= 0; j--) { for (j = i - 1; j >= 0; j--) {