[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1370291306-3276-1-git-send-email-wsa@the-dreams.de>
Date: Mon, 3 Jun 2013 22:27:17 +0200
From: Wolfram Sang <wsa@...-dreams.de>
To: linux-kernel@...r.kernel.org
Cc: Wolfram Sang <wsa@...-dreams.de>,
Thierry Reding <thierry.reding@...onic-design.de>
Subject: [PATCH] pwm: devm: alloc correct pointer size
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@...-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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists