diff options
| author | Connor O'Brien <connoro@google.com> | 2018-03-30 16:43:26 -0700 |
|---|---|---|
| committer | Connor O'Brien <connoro@google.com> | 2018-04-02 18:17:27 +0000 |
| commit | a89da170dbe49ce3ae9a1800fc58bdc54f923ccc (patch) | |
| tree | a8cd8faed981760a493d6071b34a8953bce7c5e9 | |
| parent | 4deb13e291d9cf7d702b23f1dfeee2253e171b20 (diff) | |
ANDROID: cpufreq: times: allocate enough space for a uid_entry
since the variable called uid_entry is a pointer, need to use
sizeof(*uid_entry) to allocate enough space for a full uid_entry
struct.
Bug: 74338318
Change-Id: I488a7cab849398ef7b1f4712b7746f8cf645209d
Signed-off-by: Connor O'Brien <connoro@google.com>
| -rw-r--r-- | drivers/cpufreq/cpufreq_times.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_times.c b/drivers/cpufreq/cpufreq_times.c index a226e39275b0..dd4ff655e5fe 100644 --- a/drivers/cpufreq/cpufreq_times.c +++ b/drivers/cpufreq/cpufreq_times.c @@ -88,7 +88,7 @@ static struct uid_entry *find_or_register_uid_locked(uid_t uid) { struct uid_entry *uid_entry, *temp; unsigned int max_state = READ_ONCE(next_offset); - size_t alloc_size = sizeof(uid_entry) + max_state * + size_t alloc_size = sizeof(*uid_entry) + max_state * sizeof(uid_entry->time_in_state[0]); uid_entry = find_uid_entry_locked(uid); |
