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

Commit ea7b4887 authored by Pavel Shilovsky's avatar Pavel Shilovsky Committed by Steve French
Browse files

CIFS: Fix cifs_do_create error hadnling



Commit d2c12719 caused a regression
in cifs_do_create error handling. Fix this by closing a file handle
in the case of a get_inode_info(_unix) error. Also remove unnecessary
checks for newinode being NULL.

Signed-off-by: default avatarPavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent 985e4ff0
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -356,19 +356,12 @@ cifs_create_get_file_info:
cifs_create_set_dentry:
	if (rc != 0) {
		cFYI(1, "Create worked, get_inode_info failed rc = %d", rc);
		CIFSSMBClose(xid, tcon, *fileHandle);
		goto out;
	}
	d_drop(direntry);
	d_add(direntry, newinode);

	/* ENOENT for create?  How weird... */
	rc = -ENOENT;
	if (!newinode) {
		CIFSSMBClose(xid, tcon, *fileHandle);
		goto out;
	}
	rc = 0;

out:
	kfree(buf);
	kfree(full_path);