[PATCH] Remove redundant kfree() NULL pointer checks in fs/jfs/

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

 



kfree() can handle a NULL pointer, don't worry about passing it one.


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

--- linux-2.6.12-rc1-mm3-orig/fs/jfs/acl.c	2005-03-02 08:37:47.000000000 +0100
+++ linux-2.6.12-rc1-mm3/fs/jfs/acl.c	2005-03-25 21:40:49.000000000 +0100
@@ -70,8 +70,7 @@ static struct posix_acl *jfs_get_acl(str
 		if (!IS_ERR(acl))
 			*p_acl = posix_acl_dup(acl);
 	}
-	if (value)
-		kfree(value);
+	kfree(value);
 	return acl;
 }
 
@@ -112,8 +111,7 @@ static int jfs_set_acl(struct inode *ino
 	}
 	rc = __jfs_setxattr(inode, ea_name, value, size, 0);
 out:
-	if (value)
-		kfree(value);
+	kfree(value);
 
 	if (!rc) {
 		if (*p_acl && (*p_acl != JFS_ACL_NOT_CACHED))
--- linux-2.6.12-rc1-mm3-orig/fs/jfs/xattr.c	2005-03-02 08:38:37.000000000 +0100
+++ linux-2.6.12-rc1-mm3/fs/jfs/xattr.c	2005-03-25 21:43:13.000000000 +0100
@@ -946,8 +946,7 @@ int __jfs_setxattr(struct inode *inode, 
       out:
 	up_write(&JFS_IP(inode)->xattr_sem);
 
-	if (os2name)
-		kfree(os2name);
+	kfree(os2name);
 
 	return rc;
 }
@@ -1042,8 +1041,7 @@ ssize_t __jfs_getxattr(struct inode *ino
       out:
 	up_read(&JFS_IP(inode)->xattr_sem);
 
-	if (os2name)
-		kfree(os2name);
+	kfree(os2name);
 
 	return size;
 }


-
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