Skip to content

Commit fa25299

Browse files
committed
btrfs: handle allocation error in update_dev_stat_item
Reviewed-by: Liu Bo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 047e5e1 commit fa25299

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/btrfs/volumes.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6956,7 +6956,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans,
69566956
key.offset = device->devid;
69576957

69586958
path = btrfs_alloc_path();
6959-
BUG_ON(!path);
6959+
if (!path)
6960+
return -ENOMEM;
69606961
ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1);
69616962
if (ret < 0) {
69626963
btrfs_warn_in_rcu(fs_info,

0 commit comments

Comments
 (0)