1
0
Fork 0

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>
hifive-unleashed-5.1
David Sterba 2017-02-15 09:35:01 +01:00
parent 047e5e17c1
commit fa2529923d
1 changed files with 2 additions and 1 deletions

View File

@ -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,