Skip to content

Commit

Permalink
btrfs: handle allocation error in update_dev_stat_item
Browse files Browse the repository at this point in the history
Reviewed-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
David Sterba committed Feb 28, 2017
1 parent 047e5e1 commit fa25299
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fa25299

Please sign in to comment.