Commit ccc46a74 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French

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: default avatarJeff Layton <jlayton@redhat.com>
Cc: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 2de970ff
...@@ -328,13 +328,16 @@ find_domain_name(struct cifsSesInfo *ses) ...@@ -328,13 +328,16 @@ find_domain_name(struct cifsSesInfo *ses)
if (!attrsize) if (!attrsize)
break; break;
if (!ses->domainName) { if (!ses->domainName) {
struct nls_table *default_nls;
ses->domainName = ses->domainName =
kmalloc(attrsize + 1, GFP_KERNEL); kmalloc(attrsize + 1, GFP_KERNEL);
if (!ses->domainName) if (!ses->domainName)
return -ENOMEM; return -ENOMEM;
default_nls = load_nls_default();
cifs_from_ucs2(ses->domainName, cifs_from_ucs2(ses->domainName,
(__le16 *)blobptr, attrsize, attrsize, (__le16 *)blobptr, attrsize, attrsize,
load_nls_default(), false); default_nls, false);
unload_nls(default_nls);
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment