Skip to content

Commit

Permalink
pwm: devm: alloc correct pointer size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wolfram Sang authored and Thierry Reding committed Jun 10, 2013
1 parent e792714 commit 77f0b9d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pwm/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 77f0b9d

Please sign in to comment.