diff options
| author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-04-03 21:52:13 -0400 |
|---|---|---|
| committer | Chris Mason <chris.mason@oracle.com> | 2011-04-05 01:19:42 -0400 |
| commit | 8b2b2d3cbefb605501342adaf64d601b545ed154 (patch) | |
| tree | 244e724c20bbdc639f06a7a59a108b1eedd55f10 | |
| parent | b44c59a80ded004e1a82712e5f9e17b131c03221 (diff) | |
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>
| -rw-r--r-- | fs/btrfs/ioctl.c | 4 |
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 | |||
| 2436 | return PTR_ERR(trans); | 2436 | return PTR_ERR(trans); |
| 2437 | transid = trans->transid; | 2437 | transid = trans->transid; |
| 2438 | ret = btrfs_commit_transaction_async(trans, root, 0); | 2438 | ret = btrfs_commit_transaction_async(trans, root, 0); |
| 2439 | if (ret) | 2439 | if (ret) { |
| 2440 | btrfs_end_transaction(trans, root); | ||
| 2440 | return ret; | 2441 | return ret; |
| 2442 | } | ||
| 2441 | 2443 | ||
| 2442 | if (argp) | 2444 | if (argp) |
| 2443 | if (copy_to_user(argp, &transid, sizeof(transid))) | 2445 | if (copy_to_user(argp, &transid, sizeof(transid))) |
