Yamin Friedman f06d0ca458 linux/dim: Fix overflow in dim calculation
While using net_dim, a dim_sample was used without ever initializing the
comps value. Added use of DIV_ROUND_DOWN_ULL() to prevent potential
overflow, it should not be a problem to save the final result in an int
because after the division by epms the value should not be larger than a
few thousand.

[ 1040.127124] UBSAN: Undefined behaviour in lib/dim/dim.c:78:23
[ 1040.130118] signed integer overflow:
[ 1040.131643] 134718714 * 100 cannot be represented in type 'int'

Fixes: 398c2b05bbee ("linux/dim: Add completions count to dim_sample")
Signed-off-by: Yamin Friedman <yaminf@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-07-25 11:34:39 -07:00
..
2019-06-21 09:58:42 -07:00
2019-05-31 08:34:32 -07:00
2019-06-14 14:18:53 -06:00
2019-07-18 16:31:27 -07:00
2019-07-07 22:15:12 -07:00
2019-07-23 13:54:27 -07:00
2019-07-07 19:23:05 -07:00
2019-07-20 12:17:45 -07:00
2019-07-14 12:22:11 -07:00
2019-07-15 11:06:27 -07:00