mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
btrfs: fix root leak if its reloc root is unexpected in merge_reloc_roots()
[ Upstream commitce6050bafb] If we have an unexpected reloc_root for our root, we jump to the out label but never drop the reference we obtained for root, resulting in a leak. Add a missing btrfs_put_root() call. Fixes:24213fa46c("btrfs: do proper error handling in merge_reloc_roots") Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
33878ba25e
commit
b3d39b0379
@@ -1991,6 +1991,7 @@ again:
|
||||
* corruption, e.g. bad reloc tree key offset.
|
||||
*/
|
||||
ret = -EINVAL;
|
||||
btrfs_put_root(root);
|
||||
goto out;
|
||||
}
|
||||
ret = merge_reloc_root(rc, root);
|
||||
|
||||
Reference in New Issue
Block a user