Skip to content
Commit b97c0b52 authored by Colin Ian King's avatar Colin Ian King Committed by Jeff Kirsher
Browse files

ixgbe: fix potential u32 overflow on shift



The u32 variable rem is being shifted using u32 arithmetic however
it is being passed to div_u64 that expects the expression to be a u64.
The 32 bit shift may potentially overflow, so cast rem to a u64 before
shifting to avoid this.  Also remove comment about overflow.

Addresses-Coverity: ("Unintentional integer overflow")
Fixes: cd458320 ("ixgbe: implement support for SDP/PPS output on X550 hardware")
Fixes: 68d9676f ("ixgbe: fix PTP SDP pin setup on X540 hardware")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 92924064
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment