diff options
author | Bragatheswaran Manickavel <[email protected]> | 2023-11-18 14:40:12 +0530 |
---|---|---|
committer | David Sterba <[email protected]> | 2023-11-23 22:27:34 +0100 |
commit | f91192cd68591c6b037da345bc9fcd5e50540358 (patch) | |
tree | 3aa61e39a57905367ff9aba8ba426953ac906245 /lib/memory-notifier-error-inject.c | |
parent | 2db313205f8b96eea467691917138d646bb50aef (diff) |
btrfs: ref-verify: fix memory leaks in btrfs_ref_tree_mod()
In btrfs_ref_tree_mod(), when !parent 're' was allocated through
kmalloc(). In the following code, if an error occurs, the execution will
be redirected to 'out' or 'out_unlock' and the function will be exited.
However, on some of the paths, 're' are not deallocated and may lead to
memory leaks.
For example: lookup_block_entry() for 'be' returns NULL, the out label
will be invoked. During that flow ref and 'ra' are freed but not 're',
which can potentially lead to a memory leak.
CC: [email protected] # 5.10+
Reported-and-tested-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=d66de4cbf532749df35f
Signed-off-by: Bragatheswaran Manickavel <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions