From 5a35633d7f0efaaba1b1da4e9fd8c2e1e3ee786f Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Tue, 21 Aug 2018 21:08:58 +0000 Subject: [PATCH] cxgbe(4): Avoid overflow while calculating channel rate. Reported by: Coverity (CID 1008352) MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/t4_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index c603c7144d0..2312b66cf7a 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -5770,7 +5770,7 @@ int t4_set_sched_ipg(struct adapter *adap, int sched, unsigned int ipg) */ static u64 chan_rate(struct adapter *adap, unsigned int bytes256) { - u64 v = bytes256 * adap->params.vpd.cclk; + u64 v = (u64)bytes256 * adap->params.vpd.cclk; return v * 62 + v / 2; }