summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiao Xie2013-07-22 10:36:57 +0200
committerChris Mason2013-09-01 14:04:27 +0200
commit3cd846d1d7640dd6b64d251cb9efd1a490d9a601 (patch)
tree081b99d7d8e80ebfa0bbe87ad10b86987e70b4d5 /fs
parentbtrfs/raid56: fix and cleanup some error paths (diff)
downloadkernel-qcow2-linux-3cd846d1d7640dd6b64d251cb9efd1a490d9a601.tar.gz
kernel-qcow2-linux-3cd846d1d7640dd6b64d251cb9efd1a490d9a601.tar.xz
kernel-qcow2-linux-3cd846d1d7640dd6b64d251cb9efd1a490d9a601.zip
Btrfs, raid56: fix memory leak when allocating pages for p/q stripes failed
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/raid56.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 0db856ceecc4..d0ecfbd9cc9f 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -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)