[PATCH 15/21] btrfs: fix memory leak during RAID 5/6 device replacement

David Sterba
2016-06-03T15:43:20Z

From: Scott Talbert <scott.talbert@hgst.com>

commit 4673272f43ae790ab9ec04e38a7542f82bb8f020 upstream.

A 'struct bio' is allocated in scrub_missing_raid56_pages(), but it was never
freed anywhere.

Signed-off-by: Scott Talbert <scott.talbert@hgst.com>
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/scrub.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 160ac3e23270..ee046f6fffe0 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -2125,6 +2125,8 @@ static void scrub_missing_raid56_end_io(struct bio *bio)
if (bio->bi_error)
sblock->no_io_error_seen = 0;

+ bio_put(bio);
+
btrfs_queue_work(fs_info->scrub_workers, &sblock->work);
}

--
2.7.1