Skip to contentSkip to conversation

Btrfs: add missing error handling to read_tree_block

PATCH New Filipe David Borba Manana 1 participant 1 message Jul 30, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: add missing error handling to read_tree_block

---
 fs/btrfs/disk-io.c |    4 ++++
 1 file changed, 4 insertions(+)
fs/btrfs/disk-io.c +4 -0
index 254cdc8..b71e882 100644
@@ -1148,6 +1148,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;
 
 }
Signature · 1 line
1.7.9.5