net/mlx5e: Prevent casting overflow
authorGal Pressman <galp@mellanox.com>
Wed, 7 Sep 2016 16:07:59 +0000 (19:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Sep 2016 23:15:29 +0000 (16:15 -0700)
commit7abc2110779b133e54ce681a4d0be3d89304eda1
tree0d63b3aedbff7c0d3111571bd47d7007d0adbbab
parente7e31ca43d6bedf1c551b1f9c7e78d51c9a45790
net/mlx5e: Prevent casting overflow

On 64 bits architectures unsigned long is longer than u32,
casting to unsigned long will result in overflow.
We need to first allocate an unsigned long variable, then assign the
wanted value.

Fixes: 665bc53969d7 ('net/mlx5e: Use new ethtool get/set link ksettings API')
Signed-off-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c