aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/link.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-11-07 04:01:34 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-07 10:54:06 -0500
commitf99d49adf527fa6f7a9c42257fa76bca6b8df1e3 (patch)
tree41dddbc336016f9dc9557cdb15300de5e599dac1 /fs/cifs/link.c
parent6044ec8882c726e325017bd948aa0cd94ad33abc (diff)
[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 <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/cifs/link.c')
-rw-r--r--fs/cifs/link.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index b43e071fe110..0f99aae33162 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -84,10 +84,8 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
84 cifsInode->time = 0; /* will force revalidate to go get info when needed */ 84 cifsInode->time = 0; /* will force revalidate to go get info when needed */
85 85
86cifs_hl_exit: 86cifs_hl_exit:
87 if (fromName) 87 kfree(fromName);
88 kfree(fromName); 88 kfree(toName);
89 if (toName)
90 kfree(toName);
91 FreeXid(xid); 89 FreeXid(xid);
92 return rc; 90 return rc;
93} 91}
@@ -206,8 +204,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
206 } 204 }
207 } 205 }
208 206
209 if (full_path) 207 kfree(full_path);
210 kfree(full_path);
211 FreeXid(xid); 208 FreeXid(xid);
212 return rc; 209 return rc;
213} 210}
@@ -253,8 +250,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
253 len = buflen; 250 len = buflen;
254 tmpbuffer = kmalloc(len,GFP_KERNEL); 251 tmpbuffer = kmalloc(len,GFP_KERNEL);
255 if(tmpbuffer == NULL) { 252 if(tmpbuffer == NULL) {
256 if (full_path) 253 kfree(full_path);
257 kfree(full_path);
258 FreeXid(xid); 254 FreeXid(xid);
259 return -ENOMEM; 255 return -ENOMEM;
260 } 256 }
@@ -303,8 +299,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
303 strncpy(tmpbuffer, referrals, len-1); 299 strncpy(tmpbuffer, referrals, len-1);
304 } 300 }
305 } 301 }
306 if(referrals) 302 kfree(referrals);
307 kfree(referrals);
308 kfree(tmp_path); 303 kfree(tmp_path);
309} 304}
310 /* BB add code like else decode referrals then memcpy to 305 /* BB add code like else decode referrals then memcpy to
@@ -323,12 +318,8 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
323 rc)); 318 rc));
324 } 319 }
325 320
326 if (tmpbuffer) { 321 kfree(tmpbuffer);
327 kfree(tmpbuffer); 322 kfree(full_path);
328 }
329 if (full_path) {
330 kfree(full_path);
331 }
332 FreeXid(xid); 323 FreeXid(xid);
333 return rc; 324 return rc;
334} 325}