diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-10-07 01:51:12 +0200 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-10-08 05:33:08 +0200 |
commit | ccc46a7402200a3b28a8fa1605ea5405a9ef66f7 (patch) | |
tree | 5b80d775dcda91764711ab685bbd2c91c9eb955d /fs/cifs/cifsencrypt.c | |
parent | cifs: implement recurring workqueue job to prune old tcons (diff) | |
download | linux-ccc46a7402200a3b28a8fa1605ea5405a9ef66f7.tar.xz linux-ccc46a7402200a3b28a8fa1605ea5405a9ef66f7.zip |
cifs: fix module refcount leak in find_domain_name
find_domain_name() uses load_nls_default which takes a module reference
on the appropriate NLS module, but doesn't put it.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Cc: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsencrypt.c')
-rw-r--r-- | fs/cifs/cifsencrypt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 730038a12982..89fb94fac4b5 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -328,13 +328,16 @@ find_domain_name(struct cifsSesInfo *ses) if (!attrsize) break; if (!ses->domainName) { + struct nls_table *default_nls; ses->domainName = kmalloc(attrsize + 1, GFP_KERNEL); if (!ses->domainName) return -ENOMEM; + default_nls = load_nls_default(); cifs_from_ucs2(ses->domainName, (__le16 *)blobptr, attrsize, attrsize, - load_nls_default(), false); + default_nls, false); + unload_nls(default_nls); break; } } |