diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-10-06 19:51:12 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2010-10-07 23:33:08 -0400 |
commit | ccc46a7402200a3b28a8fa1605ea5405a9ef66f7 (patch) | |
tree | 5b80d775dcda91764711ab685bbd2c91c9eb955d /fs/cifs | |
parent | 2de970ff69bbcc5a4b7440df669a595b2b1acd73 (diff) |
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.c | 5 |
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) | |||
328 | if (!attrsize) | 328 | if (!attrsize) |
329 | break; | 329 | break; |
330 | if (!ses->domainName) { | 330 | if (!ses->domainName) { |
331 | struct nls_table *default_nls; | ||
331 | ses->domainName = | 332 | ses->domainName = |
332 | kmalloc(attrsize + 1, GFP_KERNEL); | 333 | kmalloc(attrsize + 1, GFP_KERNEL); |
333 | if (!ses->domainName) | 334 | if (!ses->domainName) |
334 | return -ENOMEM; | 335 | return -ENOMEM; |
336 | default_nls = load_nls_default(); | ||
335 | cifs_from_ucs2(ses->domainName, | 337 | cifs_from_ucs2(ses->domainName, |
336 | (__le16 *)blobptr, attrsize, attrsize, | 338 | (__le16 *)blobptr, attrsize, attrsize, |
337 | load_nls_default(), false); | 339 | default_nls, false); |
340 | unload_nls(default_nls); | ||
338 | break; | 341 | break; |
339 | } | 342 | } |
340 | } | 343 | } |