From patchwork Wed Apr 7 09:33:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 91012 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o37AUNrT023992 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 7 Apr 2010 10:30:59 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NzSVl-0003Nx-0P; Wed, 07 Apr 2010 10:29:29 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NzRds-0002In-M8 for dri-devel@lists.sourceforge.net; Wed, 07 Apr 2010 09:33:48 +0000 Received-SPF: pass (sfi-mx-2.v28.ch3.sourceforge.com: domain of gmail.com designates 72.14.220.159 as permitted sender) client-ip=72.14.220.159; envelope-from=error27@gmail.com; helo=fg-out-1718.google.com; Received: from fg-out-1718.google.com ([72.14.220.159]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NzRdr-0006JH-UD for dri-devel@lists.sourceforge.net; Wed, 07 Apr 2010 09:33:48 +0000 Received: by fg-out-1718.google.com with SMTP id d23so318404fga.10 for ; Wed, 07 Apr 2010 02:33:42 -0700 (PDT) Received: by 10.102.15.13 with SMTP id 13mr4630255muo.91.1270632821921; Wed, 07 Apr 2010 02:33:41 -0700 (PDT) Received: from bicker ([196.43.68.50]) by mx.google.com with ESMTPS id s10sm5790795muh.35.2010.04.07.02.33.38 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 07 Apr 2010 02:33:41 -0700 (PDT) Date: Wed, 7 Apr 2010 12:33:36 +0300 From: Dan Carpenter To: David Airlie Subject: [patch] nouveau: fix memory leak Message-ID: <20100407093336.GE5157@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: -0.1 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 1.4 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NzRdr-0006JH-UD X-Mailman-Approved-At: Wed, 07 Apr 2010 10:29:27 +0000 Cc: Christoph Lameter , kernel-janitors@vger.kernel.org, Julia Lawall , Ben Skeggs , Tejun Heo , dri-devel@lists.sourceforge.net X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 07 Apr 2010 10:31:10 +0000 (UTC) diff --git a/drivers/gpu/drm/nouveau/nouveau_grctx.c b/drivers/gpu/drm/nouveau/nouveau_grctx.c index 32f0e49..06642a5 100644 --- a/drivers/gpu/drm/nouveau/nouveau_grctx.c +++ b/drivers/gpu/drm/nouveau/nouveau_grctx.c @@ -134,15 +134,11 @@ nouveau_grctx_fini(struct drm_device *dev) struct drm_nouveau_private *dev_priv = dev->dev_private; struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; - if (pgraph->ctxprog) { - kfree(pgraph->ctxprog); - pgraph->ctxprog = NULL; - } + kfree(pgraph->ctxprog); + pgraph->ctxprog = NULL; - if (pgraph->ctxvals) { - kfree(pgraph->ctxprog); - pgraph->ctxvals = NULL; - } + kfree(pgraph->ctxvals); + pgraph->ctxvals = NULL; } void