From: Jesper Juhl kfree() handles NULL pointers fine - checking is redundant. Signed-off-by: Jesper Juhl Signed-off-by: Andrew Morton --- 25-akpm/fs/ext3/acl.c | 6 ++---- 25-akpm/fs/ext3/super.c | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff -puN fs/ext3/acl.c~kfree-null-pointer-cleanups-no-need-to-check-fs-ext3 fs/ext3/acl.c --- 25/fs/ext3/acl.c~kfree-null-pointer-cleanups-no-need-to-check-fs-ext3 2005-03-30 18:02:09.000000000 -0800 +++ 25-akpm/fs/ext3/acl.c 2005-03-30 18:02:09.000000000 -0800 @@ -197,8 +197,7 @@ ext3_get_acl(struct inode *inode, int ty acl = NULL; else acl = ERR_PTR(retval); - if (value) - kfree(value); + kfree(value); if (!IS_ERR(acl)) { switch(type) { @@ -267,8 +266,7 @@ ext3_set_acl(handle_t *handle, struct in error = ext3_xattr_set_handle(handle, inode, name_index, "", value, size, 0); - if (value) - kfree(value); + kfree(value); if (!error) { switch(type) { case ACL_TYPE_ACCESS: diff -puN fs/ext3/super.c~kfree-null-pointer-cleanups-no-need-to-check-fs-ext3 fs/ext3/super.c --- 25/fs/ext3/super.c~kfree-null-pointer-cleanups-no-need-to-check-fs-ext3 2005-03-30 18:02:09.000000000 -0800 +++ 25-akpm/fs/ext3/super.c 2005-03-30 18:02:09.000000000 -0800 @@ -395,10 +395,8 @@ static void ext3_put_super (struct super percpu_counter_destroy(&sbi->s_dirs_counter); brelse(sbi->s_sbh); #ifdef CONFIG_QUOTA - for (i = 0; i < MAXQUOTAS; i++) { - if (sbi->s_qf_names[i]) - kfree(sbi->s_qf_names[i]); - } + for (i = 0; i < MAXQUOTAS; i++) + kfree(sbi->s_qf_names[i]); #endif /* Debugging code just in case the in-memory inode orphan list @@ -883,10 +881,8 @@ clear_qf_name: "quota turned on.\n"); return 0; } - if (sbi->s_qf_names[qtype]) { - kfree(sbi->s_qf_names[qtype]); - sbi->s_qf_names[qtype] = NULL; - } + kfree(sbi->s_qf_names[qtype]); + sbi->s_qf_names[qtype] = NULL; break; case Opt_jqfmt_vfsold: sbi->s_jquota_fmt = QFMT_VFS_OLD; _