timekeeping: fix 32-bit overflow in get_monotonic_boottime
authorColin Cross <ccross@android.com>
Wed, 26 Sep 2012 21:21:22 +0000 (14:21 -0700)
committer黄涛 <huangtao@rock-chips.com>
Mon, 8 Oct 2012 01:32:23 +0000 (09:32 +0800)
commitd21898f6906195730532b4fb99eab3d2a61089a6
treecfecc2b5871af2c1de96f76920da73d83286c639
parentfe2ebf069142d918df14ab52feac89d9b6291d03
timekeeping: fix 32-bit overflow in get_monotonic_boottime

get_monotonic_boottime adds three nanonsecond values stored
in longs, followed by an s64.  If the long values are all
close to 1e9 the first three additions can overflow and
become negative when added to the s64.  Cast the first
value to s64 so that all additions are 64 bit.

Change-Id: Ic996d8b6fbef0b72f2d027b0d8ef5259b5c1a540
Signed-off-by: Colin Cross <ccross@android.com>
kernel/time/timekeeping.c