提交 259692bd 编写于 作者: J Jesper Juhl 提交者: Dave Kleikamp

JFS: Remove redundant kfree() NULL pointer checks

kfree() can handle a NULL pointer, don't worry about passing it one. 
Signed-off-by: NJesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: NDave Kleikamp <shaggy@austin.ibm.com>
上级 6f817abc
...@@ -70,7 +70,6 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type) ...@@ -70,7 +70,6 @@ static struct posix_acl *jfs_get_acl(struct inode *inode, int type)
if (!IS_ERR(acl)) if (!IS_ERR(acl))
*p_acl = posix_acl_dup(acl); *p_acl = posix_acl_dup(acl);
} }
if (value)
kfree(value); kfree(value);
return acl; return acl;
} }
...@@ -112,7 +111,6 @@ static int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) ...@@ -112,7 +111,6 @@ static int jfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
} }
rc = __jfs_setxattr(inode, ea_name, value, size, 0); rc = __jfs_setxattr(inode, ea_name, value, size, 0);
out: out:
if (value)
kfree(value); kfree(value);
if (!rc) { if (!rc) {
......
...@@ -946,7 +946,6 @@ int __jfs_setxattr(struct inode *inode, const char *name, const void *value, ...@@ -946,7 +946,6 @@ int __jfs_setxattr(struct inode *inode, const char *name, const void *value,
out: out:
up_write(&JFS_IP(inode)->xattr_sem); up_write(&JFS_IP(inode)->xattr_sem);
if (os2name)
kfree(os2name); kfree(os2name);
return rc; return rc;
...@@ -1042,7 +1041,6 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data, ...@@ -1042,7 +1041,6 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data,
out: out:
up_read(&JFS_IP(inode)->xattr_sem); up_read(&JFS_IP(inode)->xattr_sem);
if (os2name)
kfree(os2name); kfree(os2name);
return size; return size;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册