summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-04-09 10:05:30 +0200
committerTakashi Iwai <tiwai@suse.de>2011-04-09 10:05:30 +0200
commit664cee46e755b37204f1731cb8726db610f3486d (patch)
tree11ed0d43eff14123534785cf25c0a2143e134e7e /fs/btrfs/file-item.c
parentMerge branch 'fix/asoc' into for-linus (diff)
parentMerge branch 'for-2.6.39' of git://git.kernel.org/pub/scm/linux/kernel/git/br... (diff)
downloadlinux-664cee46e755b37204f1731cb8726db610f3486d.tar.xz
linux-664cee46e755b37204f1731cb8726db610f3486d.zip
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'fs/btrfs/file-item.c')
-rw-r--r--fs/btrfs/file-item.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index 4f19a3e1bf32..a6a9d4e8b491 100644
--- a/fs/btrfs/file-item.c
+++ b/fs/btrfs/file-item.c
@@ -48,7 +48,8 @@ int btrfs_insert_file_extent(struct btrfs_trans_handle *trans,
struct extent_buffer *leaf;
path = btrfs_alloc_path();
- BUG_ON(!path);
+ if (!path)
+ return -ENOMEM;
file_key.objectid = objectid;
file_key.offset = pos;
btrfs_set_key_type(&file_key, BTRFS_EXTENT_DATA_KEY);
@@ -169,6 +170,8 @@ static int __btrfs_lookup_bio_sums(struct btrfs_root *root,
struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
path = btrfs_alloc_path();
+ if (!path)
+ return -ENOMEM;
if (bio->bi_size > PAGE_CACHE_SIZE * 8)
path->reada = 2;