From: emilgoode@gmail.com (Emil Goode)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration
Date: Sun, 18 May 2014 22:50:59 +0200 [thread overview]
Message-ID: <1400446261-27085-2-git-send-email-emilgoode@gmail.com> (raw)
In-Reply-To: <1400446261-27085-1-git-send-email-emilgoode@gmail.com>
If we fail to allocate struct platform_device pdev we
dereference it after the goto label err.
This bug was found using coccinelle.
Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
v4: Simplified version that just fixes the bug.
Also updated the changelog.
v3: Made subject line more specific.
v2: Changed to return -ENOMEM instead of ret where possible and
updated the subject line.
arch/arm/mach-imx/devices/platform-ipu-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/devices/platform-ipu-core.c b/arch/arm/mach-imx/devices/platform-ipu-core.c
index fc4dd7c..6bd7c3f 100644
--- a/arch/arm/mach-imx/devices/platform-ipu-core.c
+++ b/arch/arm/mach-imx/devices/platform-ipu-core.c
@@ -77,7 +77,7 @@ struct platform_device *__init imx_alloc_mx3_camera(
pdev = platform_device_alloc("mx3-camera", 0);
if (!pdev)
- goto err;
+ return ERR_PTR(-ENOMEM);
pdev->dev.dma_mask = kmalloc(sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
if (!pdev->dev.dma_mask)
--
1.7.10.4
next prev parent reply other threads:[~2014-05-18 20:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 20:50 [PATCH 0/2] ARM: imx: bug fix and convertion to platform_device_register_full() Emil Goode
2014-05-18 20:50 ` Emil Goode [this message]
2014-05-19 6:31 ` [PATCH 1/2 v4] ARM: imx: fix error handling in ipu device registration Uwe Kleine-König
2014-05-19 6:47 ` Shawn Guo
2014-05-18 20:51 ` [PATCH 2/2] ARM: imx: convert camera init to use platform_device_register_full() Emil Goode
2014-05-19 6:27 ` Uwe Kleine-König
2014-05-20 11:43 ` Emil Goode
2014-05-22 10:32 ` Emil Goode
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=1400446261-27085-2-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).