Btrfs: fix memory leak in start_transaction()

Free btrfs_trans_handle when join_transaction() fails
in start_transaction()

Signed-off-by: Yoshinori Sano <yoshinori.sano@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Yoshinori Sano 2011-04-03 12:31:28 +00:00 committed by Chris Mason
parent 8b2b2d3cbe
commit 6e8df2ae89
1 changed files with 1 additions and 0 deletions

View File

@ -197,6 +197,7 @@ again:
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);