summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2011-04-04 03:52:13 +0200
committerChris Mason <chris.mason@oracle.com>2011-04-05 07:19:42 +0200
commit8b2b2d3cbefb605501342adaf64d601b545ed154 (patch)
tree244e724c20bbdc639f06a7a59a108b1eedd55f10 /fs/btrfs
parentBtrfs: fix subvol_sem leak in btrfs_rename() (diff)
downloadlinux-8b2b2d3cbefb605501342adaf64d601b545ed154.tar.xz
linux-8b2b2d3cbefb605501342adaf64d601b545ed154.zip
Btrfs: fix memory leak in btrfs_ioctl_start_sync()
Call btrfs_end_transaction() if btrfs_commit_transaction_async() fails. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ioctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 6b70e0e2bd1e..255c7c5279c4 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2436,8 +2436,10 @@ static noinline long btrfs_ioctl_start_sync(struct file *file, void __user *argp
return PTR_ERR(trans);
transid = trans->transid;
ret = btrfs_commit_transaction_async(trans, root, 0);
- if (ret)
+ if (ret) {
+ btrfs_end_transaction(trans, root);
return ret;
+ }
if (argp)
if (copy_to_user(argp, &transid, sizeof(transid)))