From 0f0fe8f710f29dbd4b2c915fc1c36962e4957b3b Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Wed, 31 Jul 2013 00:39:56 +0100 Subject: [PATCH] Btrfs: add missing error handling to read_tree_block Signed-off-by: Filipe David Borba Manana Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- fs/btrfs/disk-io.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 1356435..2a378ab 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1149,6 +1149,10 @@ struct extent_buffer *read_tree_block(struct btrfs_root *root, u64 bytenr, return NULL; ret = btree_read_extent_buffer_pages(root, buf, 0, parent_transid); + if (ret) { + free_extent_buffer(buf); + return NULL; + } return buf; } -- 2.7.4