From d0e719df4a592bc35f3ed77b86c28cf4425958e7 Mon Sep 17 00:00:00 2001 From: saranyad Date: Wed, 19 Feb 2025 09:33:26 +0000 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3305934 Reviewed-by: svcacv Reviewed-by: Vinod Gopalakrishnakurup GVS: buildbot_gerritrpt --- drivers/platform/tegra/dce/dce-client-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/tegra/dce/dce-client-ipc.c b/drivers/platform/tegra/dce/dce-client-ipc.c index feaa42e5..0205d0a2 100644 --- a/drivers/platform/tegra/dce/dce-client-ipc.c +++ b/drivers/platform/tegra/dce/dce-client-ipc.c @@ -318,7 +318,7 @@ int dce_client_init(struct tegra_dce *d) } fail_work_init: - if (ret) { + if (ret && (i > 0)) { uint8_t j = 0; for (j = i - 1; j >= 0; j--) {