lkml.org 
[lkml]   [2013]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] btrfs: raid56: avoid double allocation
Date
alloc_rbio frees already bbio and raid_map, therefore they don't
need to be freed in case it fails

Signed-off-by: Andi Shyti <andi@etezian.org>
---
fs/btrfs/raid56.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/raid56.c b/fs/btrfs/raid56.c
index 0525e13..35fe775 100644
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@ -1687,11 +1687,9 @@ int raid56_parity_write(struct btrfs_root *root, struct bio *bio,
struct blk_plug_cb *cb;

rbio = alloc_rbio(root, bbio, raid_map, stripe_len);
- if (IS_ERR(rbio)) {
- kfree(raid_map);
- kfree(bbio);
+ if (IS_ERR(rbio))
return PTR_ERR(rbio);
- }
+
bio_list_add(&rbio->bio_list, bio);
rbio->bio_list_bytes = bio->bi_size;

--
1.8.3.2


\
 
 \ /
  Last update: 2013-07-25 02:21    [W:0.043 / U:14.628 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site