diff options
author | Liam R. Howlett <Liam.Howlett@oracle.com> | 2022-07-20 20:41:04 -0400 |
---|---|---|
committer | Liam R. Howlett <Liam.Howlett@oracle.com> | 2022-07-20 20:41:04 -0400 |
commit | 102e6194d01c1605885e330fcb67ed66d08038a5 (patch) | |
tree | 6455986ba2344c73e12f0459f00713ea1c9de27b /lib/percpu_test.c | |
parent | 48387ec1e1de51af42e875bcec8fa96c34316e16 (diff) |
maple_tree: Add a mas_destroy() call to mas_expected_entries() failure
path
In an exceedingly rare case, there is a possibility that allocating all
of the nodes may fail in a way that the maple state is left with some
allocations completed. This would happen if the single allocation
succeeds but bulk allocation fails, or if multiple bulk allocations are
required and somewhere along the way one fails. The partial return is
already cleaned up, but the successful allocations will remain in the
maple state. When this happens, mas_expected_entries() may leak memory.
Fix this by moving mas_destroy() above mas_expected_entries() and add a
call to mas_destroy() to clear out all allocated memory.
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Diffstat (limited to 'lib/percpu_test.c')
0 files changed, 0 insertions, 0 deletions