Btrfs, raid56: fix memory leak when allocating pages for p/q stripes failed
authorMiao Xie <miaox@cn.fujitsu.com>
Mon, 22 Jul 2013 08:36:57 +0000 (16:36 +0800)
committerChris Mason <chris.mason@fusionio.com>
Sun, 1 Sep 2013 12:04:27 +0000 (08:04 -0400)
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
fs/btrfs/raid56.c

index 0db856ceecc42c016749172fb3ae96005ed7aa98..d0ecfbd9cc9fc5e07a23173b0d1482d5eb9fb75d 100644 (file)
@@ -1540,8 +1540,10 @@ static int full_stripe_write(struct btrfs_raid_bio *rbio)
        int ret;
 
        ret = alloc_rbio_parity_pages(rbio);
-       if (ret)
+       if (ret) {
+               __free_raid_bio(rbio);
                return ret;
+       }
 
        ret = lock_stripe_add(rbio);
        if (ret == 0)