You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Chris Mason
parent
b44c59a80d
commit
8b2b2d3cbe
+3
-1
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user