diff options
author | Jesper Juhl <juhl-lkml@dif.dk> | 2005-05-09 11:47:14 -0400 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2005-05-09 11:47:14 -0400 |
commit | 259692bd5a2b2c2d351dd90748ba4126bc2a21b9 (patch) | |
tree | fa35d57768a76bbd88fa54b33daf922e9415f9da | |
parent | 6f817abc643ec84cf07c99f964d04976212e1fd3 (diff) |
JFS: Remove redundant kfree() NULL pointer checks
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>
-rw-r--r-- | fs/jfs/acl.c | 6 | ||||
-rw-r--r-- | fs/jfs/xattr.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/fs/jfs/acl.c b/fs/jfs/acl.c index 8d2a9ab981d4..30a2bf9eeda5 100644 --- a/fs/jfs/acl.c +++ b/fs/jfs/acl.c | |||
@@ -70,8 +70,7 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type) | |||
70 | if (!IS_ERR(acl)) | 70 | if (!IS_ERR(acl)) |
71 | *p_acl = posix_acl_dup(acl); | 71 | *p_acl = posix_acl_dup(acl); |
72 | } | 72 | } |
73 | if (value) | 73 | kfree(value); |
74 | kfree(value); | ||
75 | return acl; | 74 | return acl; |
76 | } | 75 | } |
77 | 76 | ||
@@ -112,8 +111,7 @@ static int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) | |||
112 | } | 111 | } |
113 | rc = __jfs_setxattr(inode, ea_name, value, size, 0); | 112 | rc = __jfs_setxattr(inode, ea_name, value, size, 0); |
114 | out: | 113 | out: |
115 | if (value) | 114 | kfree(value); |
116 | kfree(value); | ||
117 | 115 | ||
118 | if (!rc) { | 116 | if (!rc) { |
119 | if (*p_acl && (*p_acl != JFS_ACL_NOT_CACHED)) | 117 | if (*p_acl && (*p_acl != JFS_ACL_NOT_CACHED)) |
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c index 7a9ffd5d03dc..6016373701a3 100644 --- a/fs/jfs/xattr.c +++ b/fs/jfs/xattr.c | |||
@@ -946,8 +946,7 @@ int __jfs_setxattr(struct inode *inode, const char *name, const void *value, | |||
946 | out: | 946 | out: |
947 | up_write(&JFS_IP(inode)->xattr_sem); | 947 | up_write(&JFS_IP(inode)->xattr_sem); |
948 | 948 | ||
949 | if (os2name) | 949 | kfree(os2name); |
950 | kfree(os2name); | ||
951 | 950 | ||
952 | return rc; | 951 | return rc; |
953 | } | 952 | } |
@@ -1042,8 +1041,7 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data, | |||
1042 | out: | 1041 | out: |
1043 | up_read(&JFS_IP(inode)->xattr_sem); | 1042 | up_read(&JFS_IP(inode)->xattr_sem); |
1044 | 1043 | ||
1045 | if (os2name) | 1044 | kfree(os2name); |
1046 | kfree(os2name); | ||
1047 | 1045 | ||
1048 | return size; | 1046 | return size; |
1049 | } | 1047 | } |