]> git.baikalelectronics.ru Git - kernel.git/commit
e1000e: fix numeric overflow in phc settime method
authorRichard Cochran <richardcochran@gmail.com>
Tue, 23 Apr 2013 01:56:34 +0000 (01:56 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 26 Apr 2013 01:30:02 +0000 (18:30 -0700)
commit622a6294e3c7a5e24e989c5db7663eb9f621ffa6
treec910921b9519b792c7a1f43963bb7804e7c714c4
parent7902a391683eabe46bdc75d0b182484702c5b9b1
e1000e: fix numeric overflow in phc settime method

The PTP Hardware Clock settime function in the e1000e driver
computes nanoseconds from a struct timespec. The code converts the
seconds field .tv_sec by multiplying it with NSEC_PER_SEC. However,
both operands are of type long, resulting in an unintended overflow.
The patch fixes the issue by using the helper function from time.h.

CC: stable <stable@vger.kernel.org>
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/e1000e/ptp.c