From patchwork Wed Jun 1 17:10:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 840972 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 p51HBSvB025504 for ; Wed, 1 Jun 2011 17:11:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759108Ab1FARLJ (ORCPT ); Wed, 1 Jun 2011 13:11:09 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:38649 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759045Ab1FARKY (ORCPT ); Wed, 1 Jun 2011 13:10:24 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 43CA819BC8D; Wed, 1 Jun 2011 19:10:23 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 19475-09; Wed, 1 Jun 2011 19:10:18 +0200 (CEST) Received: from palace.topps.diku.dk (palace.ekstranet.diku.dk [192.38.115.202]) by mgw2.diku.dk (Postfix) with ESMTP id 6FD9419BC75; Wed, 1 Jun 2011 19:10:14 +0200 (CEST) From: Julia Lawall To: Sascha Hauer Cc: kernel-janitors@vger.kernel.org, Paul Mundt , linux-fbdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 8/10] drivers/video/imxfb.c: add missing clk_put Date: Wed, 1 Jun 2011 19:10:11 +0200 Message-Id: <1306948213-20767-8-git-send-email-julia@diku.dk> X-Mailer: git-send-email 1.7.1 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 01 Jun 2011 17:11:35 +0000 (UTC) From: Julia Lawall Reorder the labels at the end of the function to correspond to the order in which the resources are allocated. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @r exists@ expression e1,e2; statement S; @@ e1 = clk_get@p1(...); ... when != e1 = e2 when != clk_put(e1) when any if (...) { ... when != clk_put(e1) when != if (...) { ... clk_put(e1) ... } * return@p3 ...; } else S // Signed-off-by: Julia Lawall Acked-by: Sascha Hauer --- drivers/video/imxfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index d2ccfd6..f135dbe 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -856,10 +856,10 @@ failed_platform_init: dma_free_writecombine(&pdev->dev,fbi->map_size,fbi->map_cpu, fbi->map_dma); failed_map: - clk_put(fbi->clk); -failed_getclock: iounmap(fbi->regs); failed_ioremap: + clk_put(fbi->clk); +failed_getclock: release_mem_region(res->start, resource_size(res)); failed_req: kfree(info->pseudo_palette);