public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc
@ 2020-04-27 11:08 Wei Yongjun
  2020-04-27 12:29 ` Wei Yongjun
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2020-04-27 11:08 UTC (permalink / raw)
  To: Lee Jones; +Cc: Wei Yongjun, linux-kernel, kernel-janitors

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/mfd/wcd934x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c
index 90341f3c6810..da910302d51a 100644
--- a/drivers/mfd/wcd934x.c
+++ b/drivers/mfd/wcd934x.c
@@ -280,7 +280,6 @@ static void wcd934x_slim_remove(struct slim_device *sdev)
 
 	regulator_bulk_disable(WCD934X_MAX_SUPPLY, ddata->supplies);
 	mfd_remove_devices(&sdev->dev);
-	kfree(ddata);
 }
 
 static const struct slim_device_id wcd934x_slim_id[] = {






^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc
  2020-04-27 11:08 [PATCH] mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc Wei Yongjun
@ 2020-04-27 12:29 ` Wei Yongjun
  2020-04-28 10:39   ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2020-04-27 12:29 UTC (permalink / raw)
  To: Lee Jones, Srinivas Kandagatla; +Cc: Wei Yongjun, linux-kernel, kernel-janitors

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Fixes: 6ac7e4d7ad70 ("mfd: wcd934x: Add support to wcd9340/wcd9341 codec")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/mfd/wcd934x.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/mfd/wcd934x.c b/drivers/mfd/wcd934x.c
index 90341f3c6810..da910302d51a 100644
--- a/drivers/mfd/wcd934x.c
+++ b/drivers/mfd/wcd934x.c
@@ -280,7 +280,6 @@ static void wcd934x_slim_remove(struct slim_device *sdev)
 
 	regulator_bulk_disable(WCD934X_MAX_SUPPLY, ddata->supplies);
 	mfd_remove_devices(&sdev->dev);
-	kfree(ddata);
 }
 
 static const struct slim_device_id wcd934x_slim_id[] = {




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc
  2020-04-27 12:29 ` Wei Yongjun
@ 2020-04-28 10:39   ` Lee Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Lee Jones @ 2020-04-28 10:39 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Srinivas Kandagatla, linux-kernel, kernel-janitors

On Mon, 27 Apr 2020, Wei Yongjun wrote:

> It's not necessary to free memory allocated with devm_kzalloc
> and using kfree leads to a double free.
> 
> Fixes: 6ac7e4d7ad70 ("mfd: wcd934x: Add support to wcd9340/wcd9341 codec")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  drivers/mfd/wcd934x.c | 1 -
>  1 file changed, 1 deletion(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-28 10:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-27 11:08 [PATCH] mfd: wcd934x: Drop kfree for memory allocated with devm_kzalloc Wei Yongjun
2020-04-27 12:29 ` Wei Yongjun
2020-04-28 10:39   ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox