[PATCH 1/1] Remove redundant kfree() NULL pointer checks
[email protected] (Dave Kleikamp) Wed, 18 May 2005 15:51:01 -0500 (CDT)
| Newsgroups | gmane.comp.file-systems.jfs.patches |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> Signed-off-by: Dave Kleikamp <[email protected]> --- commit 259692bd5a2b2c2d351dd90748ba4126bc2a21b9 tree fa35d57768a76bbd88fa54b33daf922e9415f9da parent 6f817abc643ec84cf07c99f964d04976212e1fd3 author Jesper Juhl <[email protected]> Mon, 09 May 2005 10:47:14 -0500 committer Dave Kleikamp <[email protected]> Mon, 09 May 2005 10:47:14 -0500 fs/jfs/acl.c | 6 ++---- fs/jfs/xattr.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) Index: fs/jfs/acl.c =================================================================== --- 982d6e35796cf0c3c01899db1a8dc062d95c92c2/fs/jfs/acl.c (mode:100644) +++ fa35d57768a76bbd88fa54b33daf922e9415f9da/fs/jfs/acl.c (mode:100644) @@ -70,8 +70,7 @@ if (!IS_ERR(acl)) *p_acl = posix_acl_dup(acl); } - if (value) - kfree(value); + kfree(value); return acl; } @@ -112,8 +111,7 @@ } 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: fs/jfs/xattr.c =================================================================== --- 982d6e35796cf0c3c01899db1a8dc062d95c92c2/fs/jfs/xattr.c (mode:100644) +++ fa35d57768a76bbd88fa54b33daf922e9415f9da/fs/jfs/xattr.c (mode:100644) @@ -946,8 +946,7 @@ out: up_write(&JFS_IP(inode)->xattr_sem); - if (os2name) - kfree(os2name); + kfree(os2name); return rc; } @@ -1042,8 +1041,7 @@ out: up_read(&JFS_IP(inode)->xattr_sem); - if (os2name) - kfree(os2name); + kfree(os2name); return size; } ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click