From patchwork Fri Sep 24 12:58:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 204492 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8OCwZ81032185 for ; Fri, 24 Sep 2010 12:58:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755980Ab0IXM6f (ORCPT ); Fri, 24 Sep 2010 08:58:35 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.122]:33454 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752668Ab0IXM6e (ORCPT ); Fri, 24 Sep 2010 08:58:34 -0400 X-Authority-Analysis: v=1.1 cv=kasTMYo0C2AitJ4ghqkt2a2WwTnhe/51phlPBAxHZYg= c=1 sm=0 a=PWxkHkoGJTAA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=pGLkceISAAAA:8 a=SfL26Qu2-nGmjvYra8UA:9 a=6liHsjVLKtS-GeBv0WpqCBol3ucA:4 a=jEp0ucaQiEUA:10 a=MSl-tDqOz04A:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:41968] helo=mail.poochiereds.net) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id D1/2E-15449-970AC9C4; Fri, 24 Sep 2010 12:58:33 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id C910D58174; Fri, 24 Sep 2010 08:58:32 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Cc: shirishpargaonkar@gmail.com, linux-cifs@vger.kernel.org Subject: [PATCH 2/2] cifs: fix module refcount leak in find_domain_name Date: Fri, 24 Sep 2010 08:58:32 -0400 Message-Id: <1285333112-9040-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.2.3 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Fri, 24 Sep 2010 12:58:35 +0000 (UTC) diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 388ebe3..ccb13e6 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -363,13 +363,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; } }