JFS: Remove redundant kfree() NULL pointer checks
authorJesper Juhl <juhl-lkml@dif.dk>
Mon, 9 May 2005 15:47:14 +0000 (10:47 -0500)
committerDave Kleikamp <shaggy@austin.ibm.com>
Mon, 9 May 2005 15:47:14 +0000 (10:47 -0500)
kfree() can handle a NULL pointer, don't worry about passing it one.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com>
fs/jfs/acl.c
fs/jfs/xattr.c

index 8d2a9ab..30a2bf9 100644 (file)
@@ -70,8 +70,7 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
                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 *inode, int type, struct posix_acl *acl)
        }
        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))
index 7a9ffd5..6016373 100644 (file)
@@ -946,8 +946,7 @@ int __jfs_setxattr(struct inode *inode, const char *name, const void *value,
       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 *inode, const char *name, void *data,
       out:
        up_read(&JFS_IP(inode)->xattr_sem);
 
-       if (os2name)
-               kfree(os2name);
+       kfree(os2name);
 
        return size;
 }