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:
parent
2de970ff69
commit
ccc46a7402
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue