lkml.org 
[lkml]   [2009]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 08/11] jfs: cleanup unload_nls() calls
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@linutronix.de>
Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

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



\
 
 \ /
  Last update: 2009-08-14 14:47    [from the cache]
©2003-2011 Jasper Spaans