]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
btrfs: fix memory leak during RAID 5/6 device replacement
authorScott Talbert <scott.talbert@hgst.com>
Mon, 9 May 2016 13:14:28 +0000 (09:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jun 2016 01:18:55 +0000 (18:18 -0700)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/scrub.c

index 160ac3e23270df5830f20271460cc82b27bd1a18..ee046f6fffe0cae05cd816ea430c4e9c8d0cd5f4 100644 (file)
@@ -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);
 }