lmkd: fix an overallocation

am: a5845e7b60

Change-Id: I923b746aed263de036baf61b4dde787e1bb1e402
This commit is contained in:
George Burgess IV 2019-12-09 14:02:45 -08:00 committed by android-build-merger
commit 7b28974872
1 changed files with 2 additions and 2 deletions

View File

@ -351,7 +351,7 @@ bool init_poll_kernel(struct kernel_poll_info *poll_info) {
static void proc_insert(struct proc* procp) {
if (!pidhash) {
pidhash = calloc(PIDHASH_SZ, sizeof(struct proc));
pidhash = calloc(PIDHASH_SZ, sizeof(*pidhash));
}
int hval = pid_hashfn(procp->pid);
@ -426,7 +426,7 @@ void stats_purge_tasknames() {
procp = next;
}
}
memset(pidhash, 0, PIDHASH_SZ * sizeof(struct proc));
memset(pidhash, 0, PIDHASH_SZ * sizeof(*pidhash));
}
#endif /* LMKD_LOG_STATS */