From: Lee Jones <lee.jones@linaro.org>
To: gnomes@lxorguk.ukuu.org.uk
Cc: linux-kernel@vger.kernel.org
Subject: Alan, can you revisit a patch you authored please?
Date: Mon, 23 Jun 2014 09:53:45 +0100 [thread overview]
Message-ID: <20140623085345.GD8847@lee--X1> (raw)
Hi Alan,
I'm looking at a patch you wrote which can be foudn below at [1]. Are
you sure it's correct to ignore i.e not return -ENOMEM from
platform_device_add_data() in pcf50633_probe()? I believe if
platform_device_add_data() returns an error we should
platform_device_put() and return immediately. Can you tell me if you
agree. If you don't, would you mind explaining to me why please?
Kind regards,
Lee
[1]
commit 18273c5b463d9f98ef81f1a6217a7f4168dd809a
Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date: Fri Jul 13 16:43:32 2012 +0100
mfd: Add missing out of memory check for pcf50633
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44561
Reported-by: <rucsoftsec@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 29c122b..45ce1fb 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -253,8 +253,13 @@ static int __devinit pcf50633_probe(struct i2c_client *client,
}
pdev->dev.parent = pcf->dev;
- platform_device_add_data(pdev, &pdata->reg_init_data[i],
- sizeof(pdata->reg_init_data[i]));
+ if (platform_device_add_data(pdev, &pdata->reg_init_data[i],
+ sizeof(pdata->reg_init_data[i])) < 0) {
+ platform_device_put(pdev);
+ dev_err(pcf->dev, "Out of memory for regulator parameters %d\n",
+ i);
+ continue;
+ }
pcf->regulator_pdev[i] = pdev;
platform_device_add(pdev);
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next reply other threads:[~2014-06-23 8:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 8:53 Lee Jones [this message]
2014-06-24 12:36 ` Alan, can you revisit a patch you authored please? One Thousand Gnomes
2014-06-24 14:19 ` Lee Jones
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=20140623085345.GD8847@lee--X1 \
--to=lee.jones@linaro.org \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.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