Commit ed027a30 authored by Nick Chung's avatar Nick Chung Committed by Edmond Chung
Browse files

Buffer: Correctly disenroll buffer to avoid memory leaks



After pa/1974512 is in, one buffer can be enrolled several times
buffer is identified by vaddr. So when buffer->enrollment_list->list
is empty, we should delete the hashmap node because there is no buffer
enrollment anymore. Otherwise, if it's not empty, we need to keep the
buffer node.
The real buffer leakage is we didn't free the enrollment_list
has been allocated.
Add kfree(buffer->enrollment_list) into buffer disenrollment to
fix memory leakage.

Bug: 199806521
Test: kmemleak_analyze.py, CTS, GCA
Signed-off-by: default avatarNick Chung <nickchung@google.com>
Change-Id: Id5904cff1f7f6d6392ff203e144479be7df1c73f
(cherry picked from commit ab45d0cd)
parent e1d89e4f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment