[alsa-devel] [PATCH 1/6] ASoC: soc-core: use devm_kzalloc() for rtd

Mark Brown broonie at kernel.org
Wed Oct 2 20:55:34 CEST 2019


On Wed, Oct 02, 2019 at 02:22:32PM +0900, Kuninori Morimoto wrote:

> From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

> Current rtd, rtd->dev, rtd->codec_dais are created by normal kzalloc(),
> but we want to use devm_kzalloc() as much as possible.
> 
> Created rtd->dev is registered by device_register() at
> soc_new_pcm_runtime(), and it will be freed at
> soc_free_pcm_runtime() by device_unregister().

These aren't using devm_ because they are done at card init time and so
might happen multiple times when other card components get removed and
added.  This shouldn't happen too much but if it does then it could end
up consuming a noticeable amount of memory.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20191002/5d89bcd8/attachment.sig>


More information about the Alsa-devel mailing list