[PATCH 1/4] ASoC: soc-dapm.c: don't use kzalloc() for param on snd_soc_dai_link_event_pre_pmu()

Mark Brown broonie at kernel.org
Tue Sep 6 14:02:11 CEST 2022


On Mon, Sep 05, 2022 at 11:17:29PM +0000, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
> 
> Current snd_soc_dai_link_event_pre_pmu() is using kzalloc() / kfree()
> for "params", but it is fixed size, and not used on private data.
> It is used for setup rtd at end of this function, just a local variable.
> We don't need to use kzalloc() / kfree() for it.
> This patch replace it as local variable.

The reason we're allocating it dynamically is that it's quite large (608
bytes on arm64) and is starting to get a bit excessive for allocation on
the stack, especially when you're building with some of the KASAN type
stuff that increases stack usage.
-------------- 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/20220906/a6bca7bc/attachment.sig>


More information about the Alsa-devel mailing list