dim_calc_stats() may cause uninitialized values to be used
From: Tony Battersby <hidden>
Date: 2021-12-01 19:53:21
I am reporting the following possible logic bug: lib/dim/dim.c::dim_calc_stats() doesn't set curr_stats if delta_us == 0, which would result in using uninitialized values in net_dim_decision() and rdma_dim_decision(). I don't know anything about this code. I encountered this only as a compiler warning compiling an out-of-tree module that had a copy of dim_calc_stats() inlined for compatibility with old kernels, and I decided to investigate and report. There is no compiler warning in mainline since dim_calc_stats() and net_dim() are in separate C files so the compiler can't fully analyze it, but it looks like mainline has the problem also, if the delta_us == 0 condition is possible. Tony Battersby Cybernetics