Skip to content
Commit 8a565ec0 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba
Browse files

btrfs: fix extent map leak in unexpected scenario at unpin_extent_cache()



At unpin_extent_cache() if we happen to find an extent map with an
unexpected start offset, we jump to the 'out' label and never release the
reference we added to the extent map through the call to
lookup_extent_mapping(), therefore resulting in a leak. So fix this by
moving the free_extent_map() under the 'out' label.

Fixes: c03c89f8 ("btrfs: handle errors returned from unpin_extent_cache()")
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 9f7eb840
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment