From: Yoshinori Sano Date: Sun, 3 Apr 2011 12:31:28 +0000 (+0000) Subject: Btrfs: fix memory leak in start_transaction() X-Git-Tag: v4.14-rc1~15069^2~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e8df2ae89ab37730c0062782f844c66ecfc97a7;p=platform%2Fkernel%2Flinux-rpi.git Btrfs: fix memory leak in start_transaction() Free btrfs_trans_handle when join_transaction() fails in start_transaction() Signed-off-by: Yoshinori Sano Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index ce48eb59d615..d01cc249a8d3 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -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);