[PATCH] kfree cleanup: fs

This is the fs/ part of the big kfree cleanup patch.

Remove pointless checks for NULL prior to calling kfree() in fs/.

Signed-off-by: Jesper Juhl <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Jesper Juhl 2005-11-07 01:01:34 -08:00 • committed by Linus Torvalds
commit f99d49adf5
39 changed files with 137 additions and 245 deletions

View file

@ -35,8 +35,7 @@ affs_put_super(struct super_block *sb)
mark_buffer_dirty(sbi->s_root_bh);
}
if (sbi->s_prefix)
kfree(sbi->s_prefix);
kfree(sbi->s_prefix);
affs_free_bitmap(sb);
affs_brelse(sbi->s_root_bh);
kfree(sbi);
@ -198,10 +197,9 @@ parse_options(char *options, uid_t *uid, gid_t *gid, int *mode, int *reserved, s
*mount_opts |= SF_MUFS;
break;
case Opt_prefix:
if (*prefix) { /* Free any previous prefix */
kfree(*prefix);
*prefix = NULL;
}
/* Free any previous prefix */
kfree(*prefix);
*prefix = NULL;
*prefix = match_strdup(&args[0]);
if (!*prefix)
return 0;
@ -462,11 +460,9 @@ got_root:
out_error:
if (root_inode)
iput(root_inode);
if (sbi->s_bitmap)
kfree(sbi->s_bitmap);
kfree(sbi->s_bitmap);
affs_brelse(root_bh);
if (sbi->s_prefix)
kfree(sbi->s_prefix);
kfree(sbi->s_prefix);
kfree(sbi);
sb->s_fs_info = NULL;
return -EINVAL;