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;
}
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Jfs-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jfs-discussion