mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
core: include: Fix cert_c defect
Signed index may evaluate to an address that could be at negative offset of an array. Use unsigned indexing. CID 479265 CID 452753 Bug 3512545 Change-Id: Iaae22838305aeeafb3ebaecc497fe1556749c5c2 Signed-off-by: Prateek Patel <prpatel@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2701054 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Chris Dragan <kdragan@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
Laxman Dewangan
parent
c7fe179f62
commit
86c8a8033d
@@ -88,7 +88,15 @@ int esc_mods_tegra_dc_config_possible(struct mods_client *client,
|
||||
}
|
||||
|
||||
for (i = 0; i < args->win_num; i++) {
|
||||
int idx = args->windows[i].index;
|
||||
unsigned int idx;
|
||||
|
||||
if (args->windows[i].index < 0) {
|
||||
cl_debug(DEBUG_TEGRADC,
|
||||
"invalid index %d for win %d\n",
|
||||
i, args->windows[i].index);
|
||||
return -EINVAL;
|
||||
}
|
||||
idx = (unsigned int)args->windows[i].index;
|
||||
|
||||
if (args->windows[i].flags &
|
||||
MODS_TEGRA_DC_WINDOW_FLAG_ENABLED) {
|
||||
|
||||
Reference in New Issue
Block a user