[PATCH] Remove not needed checks for NULL before calling kfree()for fs/befs/

From: Jesper Juhl
Date: Fri Mar 25 2005 - 16:22:43 EST



There's no problem in passing kfree() a NULL pointer. Checking first is
not needed.


Signed-off-by: Jesper Juhl <juhl-lkml@xxxxxx>

--- linux-2.6.12-rc1-mm3-orig/fs/befs/linuxvfs.c 2005-03-02 08:38:07.000000000 +0100
+++ linux-2.6.12-rc1-mm3/fs/befs/linuxvfs.c 2005-03-25 21:36:53.000000000 +0100
@@ -731,20 +731,16 @@ parse_options(char *options, befs_mount_
static void
befs_put_super(struct super_block *sb)
{
- if (BEFS_SB(sb)->mount_opts.iocharset) {
- kfree(BEFS_SB(sb)->mount_opts.iocharset);
- BEFS_SB(sb)->mount_opts.iocharset = NULL;
- }
+ kfree(BEFS_SB(sb)->mount_opts.iocharset);
+ BEFS_SB(sb)->mount_opts.iocharset = NULL;

if (BEFS_SB(sb)->nls) {
unload_nls(BEFS_SB(sb)->nls);
BEFS_SB(sb)->nls = NULL;
}

- if (sb->s_fs_info) {
- kfree(sb->s_fs_info);
- sb->s_fs_info = NULL;
- }
+ kfree(sb->s_fs_info);
+ sb->s_fs_info = NULL;
return;
}



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/