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>
This commit is contained in:
Jeff Layton 2010-10-06 19:51:12 -04:00 committed by Steve French
parent 2de970ff69
commit ccc46a7402
1 changed files with 4 additions and 1 deletions

View File

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