From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Ian Molton <spyro@f2s.com>,
Dmitry Baryshkov <dbaryshkov@gmail.com>
Subject: [PATCH] mfd-core: properly handle platform_device_add_resources fail in mfd_add_device
Date: Mon, 31 May 2010 17:30:55 +0800 [thread overview]
Message-ID: <1275298255.23779.2.camel@mola> (raw)
platform_device_add_resources may fail, thus add error checking for it.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
drivers/mfd/mfd-core.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 7dd76bc..1823a57 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -70,7 +70,9 @@ static int mfd_add_device(struct device *parent, int id,
goto fail_res;
}
- platform_device_add_resources(pdev, res, cell->num_resources);
+ ret = platform_device_add_resources(pdev, res, cell->num_resources);
+ if (ret)
+ goto fail_res;
ret = platform_device_add(pdev);
if (ret)
--
1.5.4.3
next reply other threads:[~2010-05-31 9:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-31 9:30 Axel Lin [this message]
2010-06-18 21:32 ` [PATCH] mfd-core: properly handle platform_device_add_resources fail in mfd_add_device Samuel Ortiz
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=1275298255.23779.2.camel@mola \
--to=axel.lin@gmail.com \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dbaryshkov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sameo@linux.intel.com \
--cc=spyro@f2s.com \
/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