diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2016-09-16 14:34:07 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2016-09-16 14:34:07 -0700 |
commit | a517d900c6b4996dd6a6ba2f600dabe1c4da717a (patch) | |
tree | ceb85027033fa99487deb1da5e8fa5ddddb92823 /kernel/time/timekeeping_debug.c | |
parent | 441e10ac4ca3a476d76091a1bd250ac4ff7306c5 (diff) | |
parent | 1d074db69c46d62ce82b331c2080e2fcb710bf4a (diff) |
Merge tag 'v4.4.21' into android-4.4.y
This is the 4.4.21 stable release
Change-Id: I03e47d6fdca8084641c4b4f9658ea0b0edb8f297
Diffstat (limited to 'kernel/time/timekeeping_debug.c')
-rw-r--r-- | kernel/time/timekeeping_debug.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/time/timekeeping_debug.c b/kernel/time/timekeeping_debug.c index f6bd65236712..107310a6f36f 100644 --- a/kernel/time/timekeeping_debug.c +++ b/kernel/time/timekeeping_debug.c @@ -23,7 +23,9 @@ #include "timekeeping_internal.h" -static unsigned int sleep_time_bin[32] = {0}; +#define NUM_BINS 32 + +static unsigned int sleep_time_bin[NUM_BINS] = {0}; static int tk_debug_show_sleep_time(struct seq_file *s, void *data) { @@ -69,6 +71,9 @@ late_initcall(tk_debug_sleep_time_init); void tk_debug_account_sleep_time(struct timespec64 *t) { - sleep_time_bin[fls(t->tv_sec)]++; + /* Cap bin index so we don't overflow the array */ + int bin = min(fls(t->tv_sec), NUM_BINS-1); + + sleep_time_bin[bin]++; } |