From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
Christoph Hellwig <hch@infradead.org>,
Petr Vandrovec <vandrove@vc.cvut.cz>
Subject: [patch 09/11] ncpfs: cleanup unload_nls() calls
Date: Fri, 14 Aug 2009 12:43:15 -0000 [thread overview]
Message-ID: <20090814123548.593005273@linutronix.de> (raw)
In-Reply-To: 20090814122657.114987508@linutronix.de
[-- Attachment #1: ncpfs-cleanup-nls-unload.patch --]
[-- Type: text/plain, Size: 1467 bytes --]
unload_nls() can be called with a NULL pointer now. Remove the pointer
checks and the NULLification of the pointers as the data structure
which contains the pointers is kfree'd right away.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
---
fs/ncpfs/inode.c | 12 ++----------
fs/ncpfs/ioctl.c | 6 ++----
2 files changed, 4 insertions(+), 14 deletions(-)
Index: linux-2.6-tip/fs/ncpfs/inode.c
===================================================================
--- linux-2.6-tip.orig/fs/ncpfs/inode.c
+++ linux-2.6-tip/fs/ncpfs/inode.c
@@ -746,16 +746,8 @@ static void ncp_put_super(struct super_b
#ifdef CONFIG_NCPFS_NLS
/* unload the NLS charsets */
- if (server->nls_vol)
- {
- unload_nls(server->nls_vol);
- server->nls_vol = NULL;
- }
- if (server->nls_io)
- {
- unload_nls(server->nls_io);
- server->nls_io = NULL;
- }
+ unload_nls(server->nls_vol);
+ unload_nls(server->nls_io);
#endif /* CONFIG_NCPFS_NLS */
if (server->info_filp)
Index: linux-2.6-tip/fs/ncpfs/ioctl.c
===================================================================
--- linux-2.6-tip.orig/fs/ncpfs/ioctl.c
+++ linux-2.6-tip/fs/ncpfs/ioctl.c
@@ -223,10 +223,8 @@ ncp_set_charsets(struct ncp_server* serv
oldset_io = server->nls_io;
server->nls_io = iocharset;
- if (oldset_cp)
- unload_nls(oldset_cp);
- if (oldset_io)
- unload_nls(oldset_io);
+ unload_nls(oldset_cp);
+ unload_nls(oldset_io);
return 0;
}
next prev parent reply other threads:[~2009-08-14 12:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-14 12:42 [patch 00/11] Cleanup unload_nls() calls Thomas Gleixner
2009-08-14 12:42 ` [patch 01/11] fs: Make unload_nls() NULL pointer safe Thomas Gleixner
2009-08-14 12:42 ` [patch 02/11] fat: cleanup fat_put_super() Thomas Gleixner
2009-08-14 13:12 ` OGAWA Hirofumi
2009-08-14 12:42 ` [patch 03/11] befs: cleanup befs_put_super() Thomas Gleixner
2009-08-14 12:42 ` [patch 04/11] cifs: cleanup unload_nls() call Thomas Gleixner
2009-08-14 12:42 ` [patch 05/11] hfs: clenaup unload_nls() calls Thomas Gleixner
2009-08-14 12:43 ` [patch 06/11] hfsplus: cleanup " Thomas Gleixner
2009-08-14 12:43 ` [patch 07/11] isofs: " Thomas Gleixner
2009-08-14 12:43 ` [patch 08/11] jfs: " Thomas Gleixner
2009-08-14 15:17 ` Dave Kleikamp
2009-08-14 12:43 ` Thomas Gleixner [this message]
2009-08-14 12:43 ` [patch 10/11] ntfs: " Thomas Gleixner
2009-08-14 12:43 ` [patch 11/11] smbfs: " Thomas Gleixner
2009-08-16 14:46 ` [patch 00/11] Cleanup " Christoph Hellwig
2009-08-16 15:00 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090814123548.593005273@linutronix.de \
--to=tglx@linutronix.de \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vandrove@vc.cvut.cz \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox