CHROMIUM: ARM: exynos: busfreq: Fix array-out-of-bound access.
authorHan Shen <shenhan@google.com>
Fri, 26 Apr 2013 00:06:14 +0000 (17:06 -0700)
committerChromeBot <chrome-bot@google.com>
Tue, 7 May 2013 21:58:44 +0000 (14:58 -0700)
In the 1st loop of
arch/arm/mach-exynos/busfreq_opp_exynos5.c:show_time_in_state, sprintf
accesses data->time_in_state[PPMU_MIF][i], where i ranges [0..6], but
time_in_state is defined as array[2][4]. Fixed by change time_in_state
definition.

BUG=None
TEST=Build successfully

Change-Id: I2d4cab59281509e33d34b55892f18635e8b7fa09
Signed-off-by: Han Shen <shenhan@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/49266
Reviewed-by: Olof Johansson <olofj@chromium.org>
arch/arm/mach-exynos/include/mach/busfreq_exynos5.h

index 1f24545..ad15b5e 100644 (file)
@@ -57,7 +57,7 @@ struct busfreq_data {
        unsigned int sampling_rate;
        struct kobject *busfreq_kobject;
        struct busfreq_table *table[PPMU_TYPE_END];
-       unsigned long long time_in_state[PPMU_TYPE_END][LV_INT_END];
+       unsigned long long time_in_state[PPMU_TYPE_END][LV_MIF_END];
        unsigned long long last_time[PPMU_TYPE_END];
        unsigned int load_history[PPMU_END][LOAD_HISTORY_SIZE];
        int index;