Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c77bd94 authored by Filipe David Borba Manana's avatar Filipe David Borba Manana Committed by Chris Mason
Browse files

Btrfs: don't leak delayed node on path allocation failure



If the path allocation failed, we would return without decrementing
the reference count in the delayed node we got before, resulting
in a leak.

Signed-off-by: default avatarFilipe David Borba Manana <fdmanana@gmail.com>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 361c093d
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1174,8 +1174,10 @@ int btrfs_commit_inode_delayed_items(struct btrfs_trans_handle *trans,
	mutex_unlock(&delayed_node->mutex);

	path = btrfs_alloc_path();
	if (!path)
	if (!path) {
		btrfs_release_delayed_node(delayed_node);
		return -ENOMEM;
	}
	path->leave_spinning = 1;

	block_rsv = trans->block_rsv;