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: 2491581 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B533ADF230 for ; Fri, 26 Apr 2013 08:31:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754356Ab3DZIbr (ORCPT ); Fri, 26 Apr 2013 04:31:47 -0400 Received: from mail-bk0-f54.google.com ([209.85.214.54]:56427 "EHLO mail-bk0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754122Ab3DZIbq (ORCPT ); Fri, 26 Apr 2013 04:31:46 -0400 Received: by mail-bk0-f54.google.com with SMTP id q11so1654622bkw.27 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 Cc: yongjun_wei@trendmicro.com.cn, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/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);