lkml.org 
[lkml]   [2023]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectlinux-6.6-rc1/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c:2175:26: style: Array index 'i' is used before limits check. [arrayIndexThenCheck]
Date
Hello there,

Static analyser cppcheck noticed the above problem. Source code is

if (dcfclk_sta_targets[i] < optimal_dcfclk_for_uclk[j] && i < num_dcfclk_sta_targets) {

Suggest new code:

if (i < num_dcfclk_sta_targets && dcfclk_sta_targets[i] < optimal_dcfclk_for_uclk[j]) {

Regards

David Binderman

\
 
 \ /
  Last update: 2023-09-11 23:46    [W:0.055 / U:0.536 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site