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

Commit 6e8df2ae authored by Yoshinori Sano's avatar Yoshinori Sano Committed by Chris Mason
Browse files

Btrfs: fix memory leak in start_transaction()



Free btrfs_trans_handle when join_transaction() fails
in start_transaction()

Signed-off-by: default avatarYoshinori Sano <yoshinori.sano@gmail.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 8b2b2d3c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@ static struct btrfs_trans_handle *start_transaction(struct btrfs_root *root,

	ret = join_transaction(root);
	if (ret < 0) {
		kmem_cache_free(btrfs_trans_handle_cachep, h);
		if (type != TRANS_JOIN_NOLOCK)
			mutex_unlock(&root->fs_info->trans_mutex);
		return ERR_PTR(ret);