提交 77f0b9d2 编写于 作者: W Wolfram Sang 提交者: Thierry Reding

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: NWolfram Sang <wsa@the-dreams.de>
Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: NThierry Reding <thierry.reding@gmail.com>
上级 e7927141
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册