diff options
author | David Sterba <dsterba@suse.com> | 2017-02-15 03:35:01 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-02-28 08:27:11 -0500 |
commit | fa2529923d3bc5f0b39ff7a7c52be74c4aea6f2a (patch) | |
tree | 228a2689749ebf77226b57041aad582f6e185e7d | |
parent | 047e5e17c1e3551ef0fb34b629c66bec0591db0d (diff) |
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>
-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 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, | |||
6956 | key.offset = device->devid; | 6956 | key.offset = device->devid; |
6957 | 6957 | ||
6958 | path = btrfs_alloc_path(); | 6958 | path = btrfs_alloc_path(); |
6959 | BUG_ON(!path); | 6959 | if (!path) |
6960 | return -ENOMEM; | ||
6960 | ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); | 6961 | ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); |
6961 | if (ret < 0) { | 6962 | if (ret < 0) { |
6962 | btrfs_warn_in_rcu(fs_info, | 6963 | btrfs_warn_in_rcu(fs_info, |