Re: [PATCH net 1/2] linux/dim: Fix overflow in dim calculation

2019-07-23 Thread Leon Romanovsky
On Tue, Jul 23, 2019 at 05:22:43PM +, Saeed Mahameed wrote: > On Tue, 2019-07-23 at 10:22 +0300, Leon Romanovsky wrote: > > From: Yamin Friedman > > > > While using net_dim, a dim_sample was used without ever initializing > > the > > comps value. Added use of DIV_ROUND_DOWN_ULL() to prevent po

Re: [PATCH net 1/2] linux/dim: Fix overflow in dim calculation

2019-07-23 Thread Saeed Mahameed
On Tue, 2019-07-23 at 10:22 +0300, Leon Romanovsky wrote: > From: Yamin Friedman > > 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

[PATCH net 1/2] linux/dim: Fix overflow in dim calculation

2019-07-23 Thread Leon Romanovsky
From: Yamin Friedman 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 larg