e1000e: fix numeric overflow in phc settime method
authorRichard Cochran <richardcochran@gmail.com>
Tue, 23 Apr 2013 01:56:34 +0000 (01:56 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 May 2013 03:33:14 +0000 (20:33 -0700)
commit851b7ca2a2426f509736448407c641c5054147d4
tree2e8de535fa656de98799614b57ed38abfc586cae
parentf5f5be06e3073714a03db1f017b325ec85c6b6e3
e1000e: fix numeric overflow in phc settime method

commit 73e3dd6b45c4c870fc2641eb04c24e3f12dab1e0 upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/e1000e/ptp.c