mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 15:40:03 +02:00
xfs: destroy seen inode bitmap when we fail to add a dirpath
LOLLM observes a memory leak in xchk_dirtree_create_path if we create
the directory path object but appending the name to the path fails.
When this happens, we don't tear down the (empty) seen inode bitmap.
This is a pretty trivial error, but let's not leave logic bombs.
Do the same for a similar bug in xrep_dirtree_create_adoption_path.
Cc: stable@vger.kernel.org # v6.10
Fixes: 928b721a11 ("xfs: teach online scrub to find directory tree structure problems")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
014c1aff60
commit
1a441c6842
|
|
@ -259,6 +259,7 @@ xchk_dirtree_create_path(
|
|||
dl->nr_paths++;
|
||||
return 0;
|
||||
out_path:
|
||||
xino_bitmap_destroy(&path->seen_inodes);
|
||||
kfree(path);
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -618,6 +618,7 @@ xrep_dirtree_create_adoption_path(
|
|||
return 0;
|
||||
|
||||
out_path:
|
||||
xino_bitmap_destroy(&path->seen_inodes);
|
||||
kfree(path);
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user