aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 90d4ee52cd4..f92ff0ed6e0 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -282,7 +282,8 @@ int btrfs_lookup_csums_range(struct btrfs_root *root, u64 start, u64 end,
282 u16 csum_size = btrfs_super_csum_size(&root->fs_info->super_copy); 282 u16 csum_size = btrfs_super_csum_size(&root->fs_info->super_copy);
283 283
284 path = btrfs_alloc_path(); 284 path = btrfs_alloc_path();
285 BUG_ON(!path); 285 if (!path)
286 return -ENOMEM;
286 287
287 if (search_commit) { 288 if (search_commit) {
288 path->skip_locking = 1; 289 path->skip_locking = 1;
@@ -672,7 +673,9 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
672 btrfs_super_csum_size(&root->fs_info->super_copy); 673 btrfs_super_csum_size(&root->fs_info->super_copy);
673 674
674 path = btrfs_alloc_path(); 675 path = btrfs_alloc_path();
675 BUG_ON(!path); 676 if (!path)
677 return -ENOMEM;
678
676 sector_sum = sums->sums; 679 sector_sum = sums->sums;
677again: 680again:
678 next_offset = (u64)-1; 681 next_offset = (u64)-1;