From patchwork Tue Apr 6 10:55:33 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 90779 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 o36B3e9e008965 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 6 Apr 2010 11:04:16 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nz6YB-0005o6-10; Tue, 06 Apr 2010 11:02:31 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by sfs-ml-1.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1Nz6Rg-0002FC-J8 for dri-devel@lists.sourceforge.net; Tue, 06 Apr 2010 10:55:48 +0000 Received-SPF: pass (sfi-mx-2.v28.ch3.sourceforge.com: domain of gmail.com designates 209.85.220.221 as permitted sender) client-ip=209.85.220.221; envelope-from=error27@gmail.com; helo=mail-fx0-f221.google.com; Received: from mail-fx0-f221.google.com ([209.85.220.221]) by sfi-mx-2.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1Nz6Rf-0006DD-Ni for dri-devel@lists.sourceforge.net; Tue, 06 Apr 2010 10:55:48 +0000 Received: by fxm21 with SMTP id 21so1852192fxm.2 for ; Tue, 06 Apr 2010 03:55:41 -0700 (PDT) Received: by 10.102.13.10 with SMTP id 10mr3744591mum.87.1270551340989; Tue, 06 Apr 2010 03:55:40 -0700 (PDT) Received: from bicker ([196.43.68.68]) by mx.google.com with ESMTPS id e10sm54431209muf.38.2010.04.06.03.55.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 06 Apr 2010 03:55:39 -0700 (PDT) Date: Tue, 6 Apr 2010 13:55:33 +0300 From: Dan Carpenter To: David Airlie Subject: [patch] radeon: small memory leak Message-ID: <20100406105533.GD21229@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Spam-Score: 2.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 2.2 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] 1.1 RCVD_IN_SORBS_WEB RBL: SORBS: sender is a abuseable web server [196.43.68.68 listed in dnsbl.sorbs.net] -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.5 SF_NO_SPF_SPAM SF_NO_SPF_SPAM -1.2 AWL AWL: From: address is in the auto white-list X-Headers-End: 1Nz6Rf-0006DD-Ni X-Mailman-Approved-At: Tue, 06 Apr 2010 11:02:29 +0000 Cc: Alex Deucher , Jerome Glisse , 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]); Tue, 06 Apr 2010 11:04:16 +0000 (UTC) diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 247f8ee..58845e0 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c @@ -1136,6 +1136,7 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32 int len, ws, ps, ptr; unsigned char op; atom_exec_context ectx; + int ret = 0; if (!base) return -EINVAL; @@ -1168,7 +1169,8 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32 if (ectx.abort) { DRM_ERROR("atombios stuck executing %04X (len %d, WS %d, PS %d) @ 0x%04X\n", base, len, ws, ps, ptr - 1); - return -EINVAL; + ret = -EINVAL; + goto free; } if (op < ATOM_OP_CNT && op > 0) @@ -1183,9 +1185,10 @@ static int atom_execute_table_locked(struct atom_context *ctx, int index, uint32 debug_depth--; SDEBUG("<<\n"); +free: if (ws) kfree(ectx.ws); - return 0; + return ret; } int atom_execute_table(struct atom_context *ctx, int index, uint32_t * params)