From: emilgoode@gmail.com (Emil Goode)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: imx: add missing kfree call in error paths
Date: Thu, 22 May 2014 15:14:42 +0200 [thread overview]
Message-ID: <1400764482-20147-1-git-send-email-emilgoode@gmail.com> (raw)
We forgot to free pdev->dev.dma_mask as it is not freed
by platform_device_put().
Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
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;
}
--
1.7.10.4
next reply other threads:[~2014-05-22 13:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-22 13:14 Emil Goode [this message]
2014-05-22 13:50 ` [PATCH] ARM: imx: add missing kfree call in error paths Dan Carpenter
2014-05-22 14:44 ` Emil Goode
2014-05-22 20:12 ` Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400764482-20147-1-git-send-email-emilgoode@gmail.com \
--to=emilgoode@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).