From ccc46a7402200a3b28a8fa1605ea5405a9ef66f7 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Wed, 6 Oct 2010 19:51:12 -0400 Subject: 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 Cc: Shirish Pargaonkar Signed-off-by: Steve French --- fs/cifs/cifsencrypt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'fs/cifs/cifsencrypt.c') diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 730038a1298..89fb94fac4b 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; } } -- cgit v1.2.3-70-g09d2