diff mbox

[-next] wlcore: sdio: drop kfree for memory allocated with devm_kzalloc

Message ID 1475073516-7328-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State Accepted
Commit f38b7c2547537a8219d273e20eb3b88e6fc6b764
Delegated to: Kalle Valo
Headers show

Commit Message

Wei Yongjun Sept. 28, 2016, 2:38 p.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

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

Fixes: d776fc86b82f ("wlcore: sdio: Populate config firmware data")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/net/wireless/ti/wlcore/sdio.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Tony Lindgren Sept. 28, 2016, 3:11 p.m. UTC | #1
* Wei Yongjun <weiyj.lk@gmail.com> [160928 07:39]:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> It's not necessary to free memory allocated with devm_kzalloc
> and using kfree leads to a double free.
> 
> Fixes: d776fc86b82f ("wlcore: sdio: Populate config firmware data")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Oops thanks for catching this:

Acked-by: Tony Lindgren <tony@atomide.com>

> ---
>  drivers/net/wireless/ti/wlcore/sdio.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
> index a6e94b1..47fe7f9 100644
> --- a/drivers/net/wireless/ti/wlcore/sdio.c
> +++ b/drivers/net/wireless/ti/wlcore/sdio.c
> @@ -391,7 +391,6 @@ static void wl1271_remove(struct sdio_func *func)
>  	pm_runtime_get_noresume(&func->dev);
>  
>  	platform_device_unregister(glue->core);
> -	kfree(glue);
>  }
>  
>  #ifdef CONFIG_PM
>
Kalle Valo Oct. 5, 2016, 4:05 p.m. UTC | #2
Wei Yongjun <weiyj.lk@gmail.com> wrote:
> From: Wei Yongjun <weiyongjun1@huawei.com>
> 
> It's not necessary to free memory allocated with devm_kzalloc
> and using kfree leads to a double free.
> 
> Fixes: d776fc86b82f ("wlcore: sdio: Populate config firmware data")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> Acked-by: Tony Lindgren <tony@atomide.com>

Patch applied to wireless-drivers.git, thanks.

f38b7c254753 wlcore: sdio: drop kfree for memory allocated with devm_kzalloc
diff mbox

Patch

diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c
index a6e94b1..47fe7f9 100644
--- a/drivers/net/wireless/ti/wlcore/sdio.c
+++ b/drivers/net/wireless/ti/wlcore/sdio.c
@@ -391,7 +391,6 @@  static void wl1271_remove(struct sdio_func *func)
 	pm_runtime_get_noresume(&func->dev);
 
 	platform_device_unregister(glue->core);
-	kfree(glue);
 }
 
 #ifdef CONFIG_PM