diff options
author | David Sterba <dsterba@suse.com> | 2017-02-15 09:35:01 +0100 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-02-28 14:27:11 +0100 |
commit | fa2529923d3bc5f0b39ff7a7c52be74c4aea6f2a (patch) | |
tree | 228a2689749ebf77226b57041aad582f6e185e7d /fs/btrfs | |
parent | 047e5e17c1e3551ef0fb34b629c66bec0591db0d (diff) | |
download | op-kernel-dev-fa2529923d3bc5f0b39ff7a7c52be74c4aea6f2a.zip op-kernel-dev-fa2529923d3bc5f0b39ff7a7c52be74c4aea6f2a.tar.gz |
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/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index b443cc7..7c8c7bb 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, |