]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/disk-io.c
Btrfs: add missing error handling to read_tree_block
[karo-tx-linux.git] / fs / btrfs / disk-io.c
index 13564354c92740b88116bab87c267c947e91ade1..2a378abb03fb630a6a075689bd4e047ccf2d43ed 100644 (file)
@@ -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;
 
 }