summaryrefslogtreecommitdiff
path: root/fs/cifs
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-10-07 03:51:12 +0400
committerSteve French <sfrench@us.ibm.com>2010-10-08 07:33:08 +0400
commitccc46a7402200a3b28a8fa1605ea5405a9ef66f7 (patch)
tree5b80d775dcda91764711ab685bbd2c91c9eb955d /fs/cifs
parent2de970ff69bbcc5a4b7440df669a595b2b1acd73 (diff)
downloadlinux-ccc46a7402200a3b28a8fa1605ea5405a9ef66f7.tar.xz
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')
-rw-r--r--fs/cifs/cifsencrypt.c5
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;
}
}