[BUG] video: fbdev: sis: possible uninitialized-variable access in SiS_SetCRT2FIFO_300()

From: Li Tuo <hidden>
Date: 2021-07-31 06:28:46
Also in: dri-devel, lkml

Hello,

Our static analysis tool finds a possible uninitialized-variable access 
in the sis driver in Linux 5.14.0-rc3:

At the beginning of the function SiS_SetCRT2FIFO_300(), the variable 
modeidindex is not initialized.
If the following conditions are false, it remains uninitialized.
5346:    if(!SiS_Pr->CRT1UsesCustomMode)
5438:    if(!SiS_Pr->UseCustomMode)

But it is accessed at:
5466:    colorth = SiS_GetColorDepth(SiS_Pr,CRT2ModeNo,modeidindex) >> 1;

I am not quite sure whether this possible uninitialized-variable access 
is real and how to fix it if it is real.
Any feedback would be appreciated, thanks!

Reported-by: TOTE Robot <redacted>

Best wishes,
Tuo Li
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help