diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-08-05 19:58:38 +0200 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-08-16 22:34:48 +0200 |
commit | 232341ba7fa15115d40f6aa0f8dd14e96e3ad375 (patch) | |
tree | 1e9c2232b754d99616e5f7770d4c637438411455 /fs/cifs/dir.c | |
parent | cifs: clean up error handling in cifs_mknod (diff) | |
download | linux-232341ba7fa15115d40f6aa0f8dd14e96e3ad375.tar.xz linux-232341ba7fa15115d40f6aa0f8dd14e96e3ad375.zip |
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: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index f17d50047f07..f9ed0751cc12 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -305,8 +305,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, full_path = build_path_from_dentry(direntry); if (full_path == NULL) { rc = -ENOMEM; - FreeXid(xid); - return rc; + goto cifs_create_out; } if (oplockEnabled) @@ -365,9 +364,8 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); if (buf == NULL) { - kfree(full_path); - FreeXid(xid); - return -ENOMEM; + rc = -ENOMEM; + goto cifs_create_out; } /* |