mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 00:45:20 +07:00
97099cc652
This is from static analysis not from testing. Depending on the value
of rcfw->cmdq_depth, then this might not cause an issue at runtime.
The BITS_TO_LONGS() macro tells us how many longs it take to hold a
bitmap. In other words, it divides by the number if bits per long and
rounds up. Then we want to take that number and multiple by
sizeof(long) to get the number of bytes to allocate.
The code here does the multiplication first so the rounding up is done
in the wrong place. So imagine we want to allocate 1 bit, then
"(1 * 8) / 64 = 1" when we round up. But it should be
"(1 / 64) * 8 = 8". In other words, because of the rounding difference
we might allocate up to "sizeof(long) - 1" bytes fewer than intended.
Fixes:
|
||
---|---|---|
.. | ||
bnxt_re.h | ||
hw_counters.c | ||
hw_counters.h | ||
ib_verbs.c | ||
ib_verbs.h | ||
Kconfig | ||
main.c | ||
Makefile | ||
qplib_fp.c | ||
qplib_fp.h | ||
qplib_rcfw.c | ||
qplib_rcfw.h | ||
qplib_res.c | ||
qplib_res.h | ||
qplib_sp.c | ||
qplib_sp.h | ||
roce_hsi.h |