]> git.baikalelectronics.ru Git - kernel.git/commit
net/dim: Fix int overflow
authorTal Gilboa <talgi@mellanox.com>
Thu, 29 Mar 2018 10:53:52 +0000 (13:53 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 30 Mar 2018 16:56:22 +0000 (12:56 -0400)
commit9d89c6034e877d73004c19eeacefb9f2e326e252
treeda900e635b115f6653c8bf6878295f0aa1b3443d
parent72c9ba7065978b0fec49345aecd30e36b04f62e9
net/dim: Fix int overflow

When calculating difference between samples, the values
are multiplied by 100. Large values may cause int overflow
when multiplied (usually on first iteration).
Fixed by forcing 100 to be of type unsigned long.

Fixes: 2ea2b496e21f ("net/mlx5e: Move dynamic interrupt coalescing code to include/linux")
Signed-off-by: Tal Gilboa <talgi@mellanox.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/net_dim.h