From e861c369ba76cbfbbac5635bc16e314649bd50b9 Mon Sep 17 00:00:00 2001 From: Han Shen Date: Thu, 25 Apr 2013 17:06:14 -0700 Subject: [PATCH] CHROMIUM: ARM: exynos: busfreq: Fix array-out-of-bound access. 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 Reviewed-on: https://gerrit.chromium.org/gerrit/49266 Reviewed-by: Olof Johansson --- arch/arm/mach-exynos/include/mach/busfreq_exynos5.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-exynos/include/mach/busfreq_exynos5.h b/arch/arm/mach-exynos/include/mach/busfreq_exynos5.h index 1f245451e98c..ad15b5e309f8 100644 --- a/arch/arm/mach-exynos/include/mach/busfreq_exynos5.h +++ b/arch/arm/mach-exynos/include/mach/busfreq_exynos5.h @@ -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; -- 2.20.1