Commit 232341ba authored by Jeff Layton's avatar Jeff Layton Committed by Steve French

cifs: consolidate error handling in several functions

cifs has a lot of complicated functions that have to clean up things on
error, but some of them don't have all of the cleanup code
well-consolidated. Clean up and consolidate error handling in several
functions.

This is in preparation of later patches that will need to put references
to the tcon link container.
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 5d9ac7fd
...@@ -305,8 +305,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, ...@@ -305,8 +305,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
full_path = build_path_from_dentry(direntry); full_path = build_path_from_dentry(direntry);
if (full_path == NULL) { if (full_path == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
FreeXid(xid); goto cifs_create_out;
return rc;
} }
if (oplockEnabled) if (oplockEnabled)
...@@ -365,9 +364,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, ...@@ -365,9 +364,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
if (buf == NULL) { if (buf == NULL) {
kfree(full_path); rc = -ENOMEM;
FreeXid(xid); goto cifs_create_out;
return -ENOMEM;
} }
/* /*
......
...@@ -242,8 +242,7 @@ int cifs_open(struct inode *inode, struct file *file) ...@@ -242,8 +242,7 @@ int cifs_open(struct inode *inode, struct file *file)
full_path = build_path_from_dentry(file->f_path.dentry); full_path = build_path_from_dentry(file->f_path.dentry);
if (full_path == NULL) { if (full_path == NULL) {
rc = -ENOMEM; rc = -ENOMEM;
FreeXid(xid); goto out;
return rc;
} }
cFYI(1, "inode = 0x%p file flags are 0x%x for %s", cFYI(1, "inode = 0x%p file flags are 0x%x for %s",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment