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:
Nick Chung <nickchung@google.com>
Change-Id: Id5904cff1f7f6d6392ff203e144479be7df1c73f
Loading