]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit0036563bc3a37366299d9839016387a8730461fd
tree0d63b3aedbff7c0d3111571bd47d7007d0adbbab
parentd7c49f65d9f1e9b02e972622210e550e8da583f8
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: d12e4eb298c3 ('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