From: Wolfram Sang <wsa@the-dreams.de>
To: linux-kernel@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>,
Thierry Reding <thierry.reding@avionic-design.de>
Subject: [PATCH] pwm: devm: alloc correct pointer size
Date: Mon, 3 Jun 2013 22:27:17 +0200 [thread overview]
Message-ID: <1370291306-3276-1-git-send-email-wsa@the-dreams.de> (raw)
The allocated object should be the size of what the pointer is pointing
to and not the size of the pointer itself.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
drivers/pwm/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 32221cb..0cf0f65 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -694,7 +694,7 @@ struct pwm_device *devm_pwm_get(struct device *dev, const char *con_id)
{
struct pwm_device **ptr, *pwm;
- ptr = devres_alloc(devm_pwm_release, sizeof(**ptr), GFP_KERNEL);
+ ptr = devres_alloc(devm_pwm_release, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return ERR_PTR(-ENOMEM);
@@ -724,7 +724,7 @@ struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np,
{
struct pwm_device **ptr, *pwm;
- ptr = devres_alloc(devm_pwm_release, sizeof(**ptr), GFP_KERNEL);
+ ptr = devres_alloc(devm_pwm_release, sizeof(*ptr), GFP_KERNEL);
if (!ptr)
return ERR_PTR(-ENOMEM);
--
1.7.10.4
next reply other threads:[~2013-06-03 20:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-03 20:27 Wolfram Sang [this message]
2013-06-06 19:43 ` Andy Shevchenko
2013-06-10 0:04 ` Wolfram Sang
2013-06-10 6:41 ` Andy Shevchenko
2013-06-10 10:51 ` Thierry Reding
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=1370291306-3276-1-git-send-email-wsa@the-dreams.de \
--to=wsa@the-dreams.de \
--cc=linux-kernel@vger.kernel.org \
--cc=thierry.reding@avionic-design.de \
/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
all inboxes | Powered by JetHome®