From: Wolfram Sang Date: Mon, 3 Jun 2013 20:27:17 +0000 (+0200) Subject: pwm: devm: alloc correct pointer size X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=77f0b9d2ff0c8ff7b36033dfc5b29dab7a0ebd9a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Andy Shevchenko Signed-off-by: Thierry Reding --- 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) { 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);