[patch 08/11] jfs: cleanup unload_nls() calls

From: Thomas Gleixner
Date: Fri Aug 14 2009 - 08:44:09 EST


unload_nls() can be called with a NULL pointer now. Remove the pointer
check and the NULLification of the pointer as the data structure which
contains the pointer is kfree'd right away.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Dave Kleikamp <shaggy@xxxxxxxxxxxxxxxxxx>

---
fs/jfs/super.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

Index: linux-2.6-tip/fs/jfs/super.c
===================================================================
--- linux-2.6-tip.orig/fs/jfs/super.c
+++ linux-2.6-tip/fs/jfs/super.c
@@ -178,13 +178,11 @@ static void jfs_put_super(struct super_b
rc = jfs_umount(sb);
if (rc)
jfs_err("jfs_umount failed with return code %d", rc);
- if (sbi->nls_tab)
- unload_nls(sbi->nls_tab);
- sbi->nls_tab = NULL;
+
+ unload_nls(sbi->nls_tab);

truncate_inode_pages(sbi->direct_inode->i_mapping, 0);
iput(sbi->direct_inode);
- sbi->direct_inode = NULL;

kfree(sbi);

@@ -347,8 +345,7 @@ static int parse_options(char *options,

if (nls_map != (void *) -1) {
/* Discard old (if remount) */
- if (sbi->nls_tab)
- unload_nls(sbi->nls_tab);
+ unload_nls(sbi->nls_tab);
sbi->nls_tab = nls_map;
}
return 1;


--
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/