btrfs-progs: return -ENOMEM properly in btrfs_read_block_groups()
[platform/upstream/btrfs-progs.git] / extent-tree.c
index 0c8152a..97cf961 100644 (file)
@@ -3255,7 +3255,7 @@ int btrfs_read_block_groups(struct btrfs_root *root)
                cache = kzalloc(sizeof(*cache), GFP_NOFS);
                if (!cache) {
                        ret = -ENOMEM;
-                       break;
+                       goto error;
                }
 
                read_extent_buffer(leaf, &cache->item,