Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fb27640 authored by Yoshinori Sano's avatar Yoshinori Sano Committed by Chris Mason
Browse files

Btrfs: fix memory leaks in btrfs_new_inode()



This patch fixes memory leaks in btrfs_new_inode().

Signed-off-by: default avatarYoshinori Sano <yoshinori.sano@gmail.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent c9ddec74
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4526,14 +4526,17 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
	BUG_ON(!path);

	inode = new_inode(root->fs_info->sb);
	if (!inode)
	if (!inode) {
		btrfs_free_path(path);
		return ERR_PTR(-ENOMEM);
	}

	if (dir) {
		trace_btrfs_inode_request(dir);

		ret = btrfs_set_inode_index(dir, index);
		if (ret) {
			btrfs_free_path(path);
			iput(inode);
			return ERR_PTR(ret);
		}