2016-09-28 14:38:44

by Wei Yongjun

[permalink] [raw]
Subject: [PATCH -next] wlcore: sdio: drop kfree for memory allocated with devm_kzalloc

From: Wei Yongjun <[email protected]>

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 <[email protected]>
---
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


2016-09-28 15:11:35

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH -next] wlcore: sdio: drop kfree for memory allocated with devm_kzalloc

* Wei Yongjun <[email protected]> [160928 07:39]:
> From: Wei Yongjun <[email protected]>
>
> 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 <[email protected]>

Oops thanks for catching this:

Acked-by: Tony Lindgren <[email protected]>

> ---
> 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
>

2016-10-05 16:05:50

by Kalle Valo

[permalink] [raw]
Subject: Re: [-next] wlcore: sdio: drop kfree for memory allocated with devm_kzalloc

Wei Yongjun <[email protected]> wrote:
> From: Wei Yongjun <[email protected]>
>
> 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 <[email protected]>
> Acked-by: Tony Lindgren <[email protected]>

Patch applied to wireless-drivers.git, thanks.

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

--
https://patchwork.kernel.org/patch/9353985/

Documentation about submitting wireless patches and checking status
from patchwork:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches