Skip to content

Commit 29fb415

Browse files
fdmananakdave
authored andcommitted
btrfs: raid56: fix memory leak of btrfs_raid_bio::stripe_uptodate_bitmap
We allocate the bitmap but we never free it in free_raid_bio_pointers(). Fix this by adding a bitmap_free() call against the stripe_uptodate_bitmap of a raid bio. Fixes: 1810350 ("btrfs: raid56: move sector_ptr::uptodate into a dedicated bitmap") Reported-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/linux-btrfs/[email protected]/ Reviewed-by: Qu Wenruo <[email protected]> Tested-by: Christoph Hellwig <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 0d0f131 commit 29fb415

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/btrfs/raid56.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ static void scrub_rbio_work_locked(struct work_struct *work);
150150
static void free_raid_bio_pointers(struct btrfs_raid_bio *rbio)
151151
{
152152
bitmap_free(rbio->error_bitmap);
153+
bitmap_free(rbio->stripe_uptodate_bitmap);
153154
kfree(rbio->stripe_pages);
154155
kfree(rbio->bio_paddrs);
155156
kfree(rbio->stripe_paddrs);

0 commit comments

Comments
 (0)