cxgbe(4): Avoid overflow while calculating channel rate.

Reported by:	Coverity (CID 1008352)
MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2018-08-21 21:08:58 +00:00
parent c8e7055577
commit 5a35633d7f

View File

@ -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;
}