From f99d49adf527fa6f7a9c42257fa76bca6b8df1e3 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 7 Nov 2005 01:01:34 -0800 Subject: [PATCH] kfree cleanup: fs This is the fs/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in fs/. Signed-off-by: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/cifs/link.c | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'fs/cifs/link.c') diff --git a/fs/cifs/link.c b/fs/cifs/link.c index b43e071fe11..0f99aae3316 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c @@ -84,10 +84,8 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, cifsInode->time = 0; /* will force revalidate to go get info when needed */ cifs_hl_exit: - if (fromName) - kfree(fromName); - if (toName) - kfree(toName); + kfree(fromName); + kfree(toName); FreeXid(xid); return rc; } @@ -206,8 +204,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) } } - if (full_path) - kfree(full_path); + kfree(full_path); FreeXid(xid); return rc; } @@ -253,8 +250,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen) len = buflen; tmpbuffer = kmalloc(len,GFP_KERNEL); if(tmpbuffer == NULL) { - if (full_path) - kfree(full_path); + kfree(full_path); FreeXid(xid); return -ENOMEM; } @@ -303,8 +299,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen) strncpy(tmpbuffer, referrals, len-1); } } - if(referrals) - kfree(referrals); + kfree(referrals); kfree(tmp_path); } /* BB add code like else decode referrals then memcpy to @@ -323,12 +318,8 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen) rc)); } - if (tmpbuffer) { - kfree(tmpbuffer); - } - if (full_path) { - kfree(full_path); - } + kfree(tmpbuffer); + kfree(full_path); FreeXid(xid); return rc; } -- cgit v1.2.3