]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
cxgbe(4): Fix potential integer overflow in t4_tstmp_to_ns.
authorNavdeep Parhar <np@FreeBSD.org>
Thu, 22 Sep 2022 15:57:25 +0000 (08:57 -0700)
committerNavdeep Parhar <np@FreeBSD.org>
Thu, 22 Sep 2022 16:47:11 +0000 (09:47 -0700)
commit02fac928ab687607786801cdf33f100c70cc6a2e
tree18a05ecc07cadbcfc829ca04caf243c4f55d83ad
parentf95c0bc89ea4fcde04b0990d57e842ef387ea896
cxgbe(4): Fix potential integer overflow in t4_tstmp_to_ns.

Coverity flagged this in its latest run but it is not a problem in
practice as the card's core clock would have to be > 4.2GHz for any
overflow to occur.

CID 1498303:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
Potentially overflowing expression "sc->params.vpd.cclk * 1000U" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned).

Reported by: Coverity Scan (CID 1498303)
Sponsored by: Chelsio Communications
sys/dev/cxgbe/t4_sge.c