aboutsummaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq_times.c
diff options
context:
space:
mode:
authorAmit Pundir <amit.pundir@linaro.org>2018-07-19 22:06:06 +0530
committerAmit Pundir <amit.pundir@linaro.org>2018-07-19 22:08:41 +0530
commite2df7f1153f05733f6a00d0bc5756828ed9f7253 (patch)
tree5a78908887e137863c2d3f8c44a50880bd9a9814 /drivers/cpufreq/cpufreq_times.c
parent9cffeb019816c7ab0fa608f87206284fc9d456c0 (diff)
parent47bbcd6bf8f926e4e009c12b18f349ffa41bafd4 (diff)
Merge remote branch 'aosp/android-4.9' into linux-linaro-lsk-v4.9-androidlsk-v4.9-18.09-androidlsk-v4.9-18.07-android
git remote aosp --> https://android.googlesource.com/kernel/common * aosp/android-4.9: ANDROID: Fix massive cpufreq_times memory leaks ANDROID: Reduce use of #ifdef CONFIG_CPU_FREQ_TIMES UPSTREAM: binder: replace "%p" with "%pK" UPSTREAM: binder: free memory on error UPSTREAM: binder: fix proc->files use-after-free UPSTREAM: Revert "FROMLIST: binder: fix proc->files use-after-free" UPSTREAM: ANDROID: binder: change down_write to down_read UPSTREAM: ANDROID: binder: correct the cmd print for BINDER_WORK_RETURN_ERROR UPSTREAM: ANDROID: binder: remove 32-bit binder interface. UPSTREAM: ANDROID: binder: re-order some conditions UPSTREAM: android: binder: use VM_ALLOC to get vm area UPSTREAM: android: binder: Use true and false for boolean values UPSTREAM: android: binder: Use octal permissions UPSTREAM: android: binder: Prefer __func__ to using hardcoded function name UPSTREAM: ANDROID: binder: make binder_alloc_new_buf_locked static and indent its arguments UPSTREAM: android: binder: Check for errors in binder_alloc_shrinker_init(). ANDROID: Add kconfig to make dm-verity check_at_most_once default enabled ANDROID: xt_qtaguid: Remove unnecessary null checks to device's name UPSTREAM: cpufreq: schedutil: use now as reference when aggregating shared policy requests ANDROID: sdcardfs: fix potential crash when reserved_mb is not zero Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Diffstat (limited to 'drivers/cpufreq/cpufreq_times.c')
-rw-r--r--drivers/cpufreq/cpufreq_times.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq_times.c b/drivers/cpufreq/cpufreq_times.c
index 6254f45ca907..0e8754b6dd72 100644
--- a/drivers/cpufreq/cpufreq_times.c
+++ b/drivers/cpufreq/cpufreq_times.c
@@ -234,16 +234,19 @@ static int uid_time_in_state_seq_show(struct seq_file *m, void *v)
void cpufreq_task_times_init(struct task_struct *p)
{
- void *temp;
unsigned long flags;
- unsigned int max_state;
spin_lock_irqsave(&task_time_in_state_lock, flags);
p->time_in_state = NULL;
spin_unlock_irqrestore(&task_time_in_state_lock, flags);
p->max_state = 0;
+}
- max_state = READ_ONCE(next_offset);
+void cpufreq_task_times_alloc(struct task_struct *p)
+{
+ void *temp;
+ unsigned long flags;
+ unsigned int max_state = READ_ONCE(next_offset);
/* We use one array to avoid multiple allocs per task */
temp = kcalloc(max_state, sizeof(p->time_in_state[0]), GFP_ATOMIC);