summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-02-15 09:35:01 +0100
committerDavid Sterba <dsterba@suse.com>2017-02-28 14:27:11 +0100
commitfa2529923d3bc5f0b39ff7a7c52be74c4aea6f2a (patch)
tree228a2689749ebf77226b57041aad582f6e185e7d /fs
parentbtrfs: remove BUG_ON from __tree_mod_log_insert (diff)
downloadlinux-fa2529923d3bc5f0b39ff7a7c52be74c4aea6f2a.tar.xz
linux-fa2529923d3bc5f0b39ff7a7c52be74c4aea6f2a.zip
btrfs: handle allocation error in update_dev_stat_item
Reviewed-by: Liu Bo <bo.li.liu@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index b443cc71830f..7c8c7bbee197 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -6956,7 +6956,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
key.offset = device->devid;
path = btrfs_alloc_path();
- BUG_ON(!path);
+ if (!path)
+ return -ENOMEM;
ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1);
if (ret < 0) {
btrfs_warn_in_rcu(fs_info,