* [PATCH] mfd-core: properly handle platform_device_add_resources fail in mfd_add_device
@ 2010-05-31 9:30 Axel Lin
2010-06-18 21:32 ` Samuel Ortiz
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-05-31 9:30 UTC (permalink / raw)
To: linux-kernel; +Cc: Samuel Ortiz, Mark Brown, Ian Molton, Dmitry Baryshkov
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mfd-core: properly handle platform_device_add_resources fail in mfd_add_device
2010-05-31 9:30 [PATCH] mfd-core: properly handle platform_device_add_resources fail in mfd_add_device Axel Lin
@ 2010-06-18 21:32 ` Samuel Ortiz
0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2010-06-18 21:32 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Mark Brown, Ian Molton, Dmitry Baryshkov
On Mon, May 31, 2010 at 05:30:55PM +0800, Axel Lin wrote:
> platform_device_add_resources may fail, thus add error checking for it.
Thanks Axel, patch applied.
Cheers,
Samuel.
> 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
>
>
>
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-06-18 21:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-31 9:30 [PATCH] mfd-core: properly handle platform_device_add_resources fail in mfd_add_device Axel Lin
2010-06-18 21:32 ` Samuel Ortiz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox