From patchwork Fri Apr 26 08:31:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2491591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 9BDA8DF230 for ; Fri, 26 Apr 2013 08:31:56 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVe4R-0000au-6Y; Fri, 26 Apr 2013 08:31:55 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVe4O-0004yF-NM; Fri, 26 Apr 2013 08:31:52 +0000 Received: from mail-bk0-x22e.google.com ([2a00:1450:4008:c01::22e]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVe4J-0004xx-Po for linux-arm-kernel@lists.infradead.org; Fri, 26 Apr 2013 08:31:50 +0000 Received: by mail-bk0-f46.google.com with SMTP id e19so1187304bku.33 for ; Fri, 26 Apr 2013 01:31:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=Ff4Ut1MR9P1FNz25blN2GQKF0FguvkCOJDVyht1hoFo=; b=Bl49GYlOopFe9onLYQej90FGloZUQ/gcsIW8yLH5QQnDph3i7N8/vpC6m9KBjSXGOz 6fnYZ9DucBXQAFMGHXth/l1Rsrvn5o4UmtqNhAtmWU78RHEswtMMYwkL8kAbjvR2AprZ A21pSksa7h8bthzfM8QwvaY7+CX7QYJ+e/VM32oU8Q109TMiNpvscNhvM+wvIGrRpHmJ /T/0AmnLOCbhgGCIkMy+yEApP1kXnTmb8hDPQoamqNj0JWoL6YBPHZMJH6RTMUxO54u8 gwDnChnv9fOrDuesGfyz3YCxUHTk0YoIi7SSSsgO08ENVeMenGMTa37Mcm3aSQ7/a+0+ SGYw== MIME-Version: 1.0 X-Received: by 10.204.226.136 with SMTP id iw8mr17687819bkb.135.1366965104944; Fri, 26 Apr 2013 01:31:44 -0700 (PDT) Received: by 10.204.175.10 with HTTP; Fri, 26 Apr 2013 01:31:44 -0700 (PDT) Date: Fri, 26 Apr 2013 16:31:44 +0800 Message-ID: Subject: [PATCH] ARM: OMAP1: DMA: fix error handling in omap1_system_dma_init() From: Wei Yongjun To: tony@atomide.com, linux@arm.linux.org.uk X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130426_043147_998556_FAD011E9 X-CRM114-Status: UNSURE ( 9.28 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (weiyj.lk[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: yongjun_wei@trendmicro.com.cn, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Wei Yongjun Add the missing iounmap() before return from omap1_system_dma_init() in the error handling case. Also removed platform_device_del() on add resources error case which cause dup device delete. Signed-off-by: Wei Yongjun --- no compile test. --- arch/arm/mach-omap1/dma.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c index 1a4e887..68ab858 100644 --- a/arch/arm/mach-omap1/dma.c +++ b/arch/arm/mach-omap1/dma.c @@ -301,7 +301,7 @@ static int __init omap1_system_dma_init(void) if (ret) { dev_err(&pdev->dev, "%s: Unable to add resources for %s%d\n", __func__, pdev->name, pdev->id); - goto exit_device_put; + goto exit_iounmap; } p = kzalloc(sizeof(struct omap_system_dma_plat_info), GFP_KERNEL); @@ -309,7 +309,7 @@ static int __init omap1_system_dma_init(void) dev_err(&pdev->dev, "%s: Unable to allocate 'p' for %s\n", __func__, pdev->name); ret = -ENOMEM; - goto exit_device_del; + goto exit_iounmap; } d = kzalloc(sizeof(struct omap_dma_dev_attr), GFP_KERNEL); @@ -402,8 +402,8 @@ exit_release_d: kfree(d); exit_release_p: kfree(p); -exit_device_del: - platform_device_del(pdev); +exit_iounmap: + iounmap(dma_base); exit_device_put: platform_device_put(pdev);