]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/cifs/link.c
[PATCH] kfree cleanup: fs
[net-next-2.6.git] / fs / cifs / link.c
index b43e071fe1106446fc2e48fc05299a7b8fabce4a..0f99aae33162fbd68f5e08a32713db3055a418cf 100644 (file)
@@ -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;
 }