[PATCH][4/7] cifs: dir.c cleanup - kfree()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Remove redundant NULL pointer checks before kfree() in fs/cifs/dir.c

Signed-off-by: Jesper Juhl <[email protected]>


--- linux-2.6.12-rc1-mm4/fs/cifs/dir.c.with_patch3	2005-04-03 00:02:22.000000000 +0200
+++ linux-2.6.12-rc1-mm4/fs/cifs/dir.c	2005-04-03 00:02:24.000000000 +0200
@@ -321,12 +321,9 @@ int cifs_create(struct inode *inode, str
 		}
 	}
 
-	if (buf)
-	    kfree(buf);
-	if (full_path)
-	    kfree(full_path);
+	kfree(buf);
+	kfree(full_path);
 	FreeXid(xid);
-
 	return rc;
 }
 
@@ -377,10 +374,8 @@ int cifs_mknod(struct inode *inode, stru
 		}
 	}
 
-	if (full_path)
-		kfree(full_path);
+	kfree(full_path);
 	FreeXid(xid);
-
 	return rc;
 }
 
@@ -450,8 +445,7 @@ struct dentry *cifs_lookup(struct inode 
 		   if file exists or not but no access BB */
 	}
 
-	if (full_path)
-		kfree(full_path);
+	kfree(full_path);
 	FreeXid(xid);
 	return ERR_PTR(rc);
 }
@@ -481,8 +475,7 @@ int cifs_dir_open(struct inode *inode, s
 
 	cFYI(1, ("inode = 0x%p and full path is %s", inode, full_path));
 
-	if (full_path)
-		kfree(full_path);
+	kfree(full_path);
 	FreeXid(xid);
 	return rc;
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux