aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2013-06-03 16:27:17 -0400
committerThierry Reding <thierry.reding@gmail.com>2013-06-10 06:50:10 -0400
commit77f0b9d2ff0c8ff7b36033dfc5b29dab7a0ebd9a (patch)
tree9c8757d3862de107cdd4fc6993550c2a36f37e00
parente7927141ed51d94d6e1267f2ff0362a1f255e007 (diff)
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@the-dreams.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r--drivers/pwm/core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 32221cb0cbe7..0cf0f65eb037 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)
694{ 694{
695 struct pwm_device **ptr, *pwm; 695 struct pwm_device **ptr, *pwm;
696 696
697 ptr = devres_alloc(devm_pwm_release, sizeof(**ptr), GFP_KERNEL); 697 ptr = devres_alloc(devm_pwm_release, sizeof(*ptr), GFP_KERNEL);
698 if (!ptr) 698 if (!ptr)
699 return ERR_PTR(-ENOMEM); 699 return ERR_PTR(-ENOMEM);
700 700
@@ -724,7 +724,7 @@ struct pwm_device *devm_of_pwm_get(struct device *dev, struct device_node *np,
724{ 724{
725 struct pwm_device **ptr, *pwm; 725 struct pwm_device **ptr, *pwm;
726 726
727 ptr = devres_alloc(devm_pwm_release, sizeof(**ptr), GFP_KERNEL); 727 ptr = devres_alloc(devm_pwm_release, sizeof(*ptr), GFP_KERNEL);
728 if (!ptr) 728 if (!ptr)
729 return ERR_PTR(-ENOMEM); 729 return ERR_PTR(-ENOMEM);
730 730