2015-04-16 13:47:32

by weiyj_lk

[permalink] [raw]
Subject: [PATCH -next] ASoC: Intel: sst_byt: remove 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.

Signed-off-by: Wei Yongjun <[email protected]>
---
sound/soc/intel/baytrail/sst-baytrail-ipc.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/sound/soc/intel/baytrail/sst-baytrail-ipc.c b/sound/soc/intel/baytrail/sst-baytrail-ipc.c
index 1efb33b..a839dbf 100644
--- a/sound/soc/intel/baytrail/sst-baytrail-ipc.c
+++ b/sound/soc/intel/baytrail/sst-baytrail-ipc.c
@@ -759,7 +759,6 @@ fw_err:
dsp_new_err:
sst_ipc_fini(ipc);
ipc_init_err:
- kfree(byt);

return err;
}


2015-04-16 14:05:46

by Jarkko Nikula

[permalink] [raw]
Subject: Re: [PATCH -next] ASoC: Intel: sst_byt: remove kfree for memory allocated with devm_kzalloc

Hi

On 04/16/2015 04:46 PM, [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.
>
> Signed-off-by: Wei Yongjun <[email protected]>
> ---
> sound/soc/intel/baytrail/sst-baytrail-ipc.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/sound/soc/intel/baytrail/sst-baytrail-ipc.c b/sound/soc/intel/baytrail/sst-baytrail-ipc.c
> index 1efb33b..a839dbf 100644
> --- a/sound/soc/intel/baytrail/sst-baytrail-ipc.c
> +++ b/sound/soc/intel/baytrail/sst-baytrail-ipc.c
> @@ -759,7 +759,6 @@ fw_err:
> dsp_new_err:
> sst_ipc_fini(ipc);
> ipc_init_err:
> - kfree(byt);
>
> return err;
> }
>
Above kfree(byt) appears to be added by accident in the commit
48cec59b6f38 ("ASoC: Intel: Use the generic IPC/mailbox APIs in Baytrail").

Acked-by: Jarkko Nikula <[email protected]>

2015-04-17 13:34:33

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH -next] ASoC: Intel: sst_byt: remove kfree for memory allocated with devm_kzalloc

On Thu, Apr 16, 2015 at 09:46:29PM +0800, [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.

Applied, thanks.


Attachments:
(No filename) (245.00 B)
signature.asc (473.00 B)
Digital signature
Download all attachments