aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Juhl <juhl-lkml@dif.dk>2005-04-03 17:40:04 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-03 17:40:04 -0700
commita0b8e21ee69ccfbed49d93707b033d59d6f2ff58 (patch)
tree4414b3a22a0e3ced41640d8b98ea66eb0a56d6aa
parenta9aab1ec2eaa11abc7d1b61276e840360bf39568 (diff)
downloadhistory-a0b8e21ee69ccfbed49d93707b033d59d6f2ff58.tar.gz
[PATCH] kfree() NULL pointer cleanups - no need to check - fs/ext3/
kfree() handles NULL pointers fine - checking is redundant. Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--fs/ext3/acl.c6
-rw-r--r--fs/ext3/super.c12
2 files changed, 6 insertions, 12 deletions
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index 926af622c53b9b..328592c3a956f9 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -197,8 +197,7 @@ ext3_get_acl(struct inode *inode, int type)
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 inode *inode, int type,
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 --git a/fs/ext3/super.c b/fs/ext3/super.c
index 53b054263a2b84..545b440a2d2fac 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -395,10 +395,8 @@ static void ext3_put_super (struct super_block * sb)
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;