[PATCH] ASoC: meson: aiu-fifo.c: use devm_kzalloc(), and remove .remove function

Mark Brown broonie at kernel.org
Fri Sep 9 18:28:58 CEST 2022


On Fri, Sep 09, 2022 at 10:27:22AM +0200, Jerome Brunet wrote:
> On Fri 09 Sep 2022 at 01:21, Kuninori Morimoto <kuninori.morimoto.gx at renesas.com> wrote:

> > Current aiu-fifo.c is using kzalloc()/kfree(), but we can replace
> > it by devm_kzalloc(), and remove kfree().
> > This patch do it.

> I'm not sure about this change Kuninori.

> This is the dai probe, not the device driver probe.
> If I'm not mistaken it gets called when binding the card.

> The components and card drivers are different here.

> If the card probes several times for any reason, EPROBE_DEFER for
> example, wouldn't this allocate the memory several times without
> releasing it ?

Yes, indeed.  You'd need to move the allocation to the device level
probe to convert to devm (which *would* be a good thing to do if
possible).
-------------- 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/20220909/903224a9/attachment.sig>


More information about the Alsa-devel mailing list