Android 12.0.0 release 0.17
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
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.
Test: kmemleak_analyze.py, CTS, GCA
Signed-off-by: Nick Chung <firstname.lastname@example.org>
(cherry picked from commit ab45d0cda10ab5aa70616b96b0db26295ab606ad)
1 file changed