From patchwork Thu May 22 13:14:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Goode X-Patchwork-Id: 351490 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 178BD140088 for ; Thu, 22 May 2014 23:18:38 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WnSqV-000206-Vn; Thu, 22 May 2014 13:15:43 +0000 Received: from mail-la0-x233.google.com ([2a00:1450:4010:c03::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WnSqT-0001gI-HZ for linux-arm-kernel@lists.infradead.org; Thu, 22 May 2014 13:15:42 +0000 Received: by mail-la0-f51.google.com with SMTP id gf5so2647215lab.10 for ; Thu, 22 May 2014 06:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=OmEo3IFqhZsnoclNujRiSRmFZQ0h6ah93UeZ4leOT3A=; b=jPglvbgiEFbVj+NB+DUcrhGU5JCoQiiTLj/Q9z4cicvUhUEs6eOIUucMtIoJVbVPme j33CVtXFQLw8+gtjijvWg5//YMsqMknaAWGIcIHGm2WTD/PbgfhdKG8VR8Andrn1Gf5I RPUp+xm0Zx5mvRJP5QwUATYastBNE8unDTitBxeaVDbX8pVzGDMmMQg5xR6BlVECmF8x jMToO5NwGIf1kd8vjt1nQT5x3P5TaHorV0u++kZBVGSHGy/8xx/yZu5GlkbZT3qdvg9U 8Zl+kISTWYW2QkW0dYRTB7gOQ6gJYzGBu97vXwuHiGuFHZOQ37yKStda4VcaNLjOZvI3 ssTQ== X-Received: by 10.152.3.41 with SMTP id 9mr29494laz.86.1400764519037; Thu, 22 May 2014 06:15:19 -0700 (PDT) Received: from lianli.example.org (s83-179-48-77.cust.tele2.se. [83.179.48.77]) by mx.google.com with ESMTPSA id bq6sm4877564lbb.34.2014.05.22.06.15.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 May 2014 06:15:18 -0700 (PDT) From: Emil Goode To: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Shawn Guo , Sascha Hauer , Russell King Subject: [PATCH] ARM: imx: add missing kfree call in error paths Date: Thu, 22 May 2014 15:14:42 +0200 Message-Id: <1400764482-20147-1-git-send-email-emilgoode@gmail.com> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140522_061541_770178_E8833B21 X-CRM114-Status: GOOD ( 11.45 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (emilgoode[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Cc: Emil Goode , kernel-janitors@vger.kernel.org, linux-kernel@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-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org We forgot to free pdev->dev.dma_mask as it is not freed by platform_device_put(). Signed-off-by: Emil Goode --- arch/arm/mach-imx/mach-mx31_3ds.c | 4 +++- arch/arm/mach-imx/mach-mx31moboard.c | 4 +++- arch/arm/mach-imx/mach-mx35_3ds.c | 4 +++- arch/arm/mach-imx/mach-pcm037.c | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c index 453f41a..8de1019 100644 --- a/arch/arm/mach-imx/mach-mx31_3ds.c +++ b/arch/arm/mach-imx/mach-mx31_3ds.c @@ -201,9 +201,11 @@ static int __init mx31_3ds_init_camera(void) goto err; ret = platform_device_add(pdev); - if (ret) + if (ret) { err: + kfree(pdev->dev.dma_mask); platform_device_put(pdev); + } return ret; } diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index 6bed570..f24a93c 100644 --- a/arch/arm/mach-imx/mach-mx31moboard.c +++ b/arch/arm/mach-imx/mach-mx31moboard.c @@ -494,9 +494,11 @@ static int __init mx31moboard_init_cam(void) goto err; ret = platform_device_add(pdev); - if (ret) + if (ret) { err: + kfree(pdev->dev.dma_mask); platform_device_put(pdev); + } return ret; diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c index 72cd77d..ffdddb3 100644 --- a/arch/arm/mach-imx/mach-mx35_3ds.c +++ b/arch/arm/mach-imx/mach-mx35_3ds.c @@ -284,9 +284,11 @@ static int __init imx35_3ds_init_camera(void) goto err; ret = platform_device_add(pdev); - if (ret) + if (ret) { err: + kfree(pdev->dev.dma_mask); platform_device_put(pdev); + } return ret; } diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c index 8eb1570..764a111 100644 --- a/arch/arm/mach-imx/mach-pcm037.c +++ b/arch/arm/mach-imx/mach-pcm037.c @@ -427,9 +427,11 @@ static int __init pcm037_init_camera(void) goto err; ret = platform_device_add(pdev); - if (ret) + if (ret) { err: + kfree(pdev->dev.dma_mask); platform_device_put(pdev); + } return ret; }