From patchwork Sat Feb 5 19:51:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Juhl X-Patchwork-Id: 537921 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p17Csss6013451 for ; Mon, 7 Feb 2011 12:55:14 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A74CA9E818 for ; Mon, 7 Feb 2011 04:54:53 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 07 Feb 2011 12:55:15 +0000 (UTC) X-Greylist: delayed 615 seconds by postgrey-1.31 at gabe; Sat, 05 Feb 2011 12:02:54 PST Received: from swampdragon.chaosbits.net (swampdragon.chaosbits.net [90.184.90.115]) by gabe.freedesktop.org (Postfix) with ESMTP id B32CF9ED79 for ; Sat, 5 Feb 2011 12:02:54 -0800 (PST) Received: by swampdragon.chaosbits.net (Postfix, from userid 1000) id 26B6A9403D; Sat, 5 Feb 2011 20:51:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by swampdragon.chaosbits.net (Postfix) with ESMTP id 18BE49403B; Sat, 5 Feb 2011 20:51:54 +0100 (CET) Date: Sat, 5 Feb 2011 20:51:53 +0100 (CET) From: Jesper Juhl To: David Airlie Subject: [PATCH] radeon mkregtable: Add missing fclose() calls Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 07 Feb 2011 04:54:45 -0800 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org diff --git a/drivers/gpu/drm/radeon/mkregtable.c b/drivers/gpu/drm/radeon/mkregtable.c index 607241c..5a82b6b 100644 --- a/drivers/gpu/drm/radeon/mkregtable.c +++ b/drivers/gpu/drm/radeon/mkregtable.c @@ -673,8 +673,10 @@ static int parser_auth(struct table *t, const char *filename) last_reg = strtol(last_reg_s, NULL, 16); do { - if (fgets(buf, 1024, file) == NULL) + if (fgets(buf, 1024, file) == NULL) { + fclose(file); return -1; + } len = strlen(buf); if (ftell(file) == end) done = 1; @@ -685,6 +687,7 @@ static int parser_auth(struct table *t, const char *filename) fprintf(stderr, "Error matching regular expression %d in %s\n", r, filename); + fclose(file); return -1; } else { buf[match[0].rm_eo] = 0;