]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_en: Resolve dividing by zero in 32-bit system
authorEugenia Emantayev <eugenia@mellanox.com>
Thu, 27 Oct 2016 13:27:16 +0000 (16:27 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Oct 2016 20:23:48 +0000 (16:23 -0400)
commit9b9fb1552f93f4ee75e3cb4116ccc59db083dcf6
tree2edd012551dd4f35a4700357471a7bc1cbfcaef8
parentc5412bec69befc921c055c584db926429e6f8fb8
net/mlx4_en: Resolve dividing by zero in 32-bit system

When doing roundup_pow_of_two for large enough number with
bit 31, an overflow will occur and a value equal to 1 will
be returned. In this case 1 will be subtracted from the return
value and division by zero will be reached.

Fixes: c1125f0d7e67 ("net/mlx4_en: Choose time-stamping shift value according to HW frequency")
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_clock.c