[alsa-devel] [PATCH resend 05/11] ASoC: soc-core: don't alloc memory carelessly when creating debugfs

Mark Brown broonie at kernel.org
Thu Aug 22 19:18:57 CEST 2019


On Tue, Aug 20, 2019 at 02:05:06PM +0900, Kuninori Morimoto wrote:

> Current ALSA SoC might allocate debugfs name memory via kasprintf(),
> but, it is unnecessary and the code becoming very complex.
> Using local variable with appropriate size is enough.

> This patch uses 64byte local variable for it.

Is it enough though?  It'd be a very long name but as soon as you
start putting a fixed limit in you're tempting fate a bit.

The other potential issue is that it's a relatively large
allocation to do on the stack and while we're probably fine it
still doesn't feel great.
-------------- 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/20190822/f8327168/attachment.sig>


More information about the Alsa-devel mailing list