Skip to content

Commit a56a70f

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 <hch@lst.de> Link: https://lore.kernel.org/linux-btrfs/20260126045315.GA31641@lst.de/ Reviewed-by: Qu Wenruo <wqu@suse.com> Tested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 5341c98 commit a56a70f

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)