[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140117184857.GH17314@sirena.org.uk>
Date: Fri, 17 Jan 2014 18:48:57 +0000
From: Mark Brown <broonie@...nel.org>
To: Lars-Peter Clausen <lars@...afoo.de>
Cc: Xiubo Li <Li.Xiubo@...escale.com>, lgirdwood@...il.com,
perex@...ex.cz, tiwai@...e.de, alsa-devel@...a-project.org,
linux-kernel@...r.kernel.org
Subject: Re: [alsa-devel] [PATCH] ASoC: core: Use devm_kzalloc() instead
kzalloc()
On Thu, Jan 16, 2014 at 10:52:35PM +0100, Lars-Peter Clausen wrote:
> On 01/16/2014 09:44 AM, Xiubo Li wrote:
> >Makes the code slightly shorter
> >Signed-off-by: Xiubo Li <Li.Xiubo@...escale.com>
> I don't like this. I don't think it is a good design pattern to call
> devm function from within (especial non-devm) library functions. It
> creates an asymmetric API. The memory is allocated when
> snd_dmaengine_pcm_register() is called, but it is not freed when
> snd_dmaengine_pcm_unregister() is called. This goes against the
> principle of least surprise.
Yes, I tend to agree - unless we only support managed registration the
API shouldn't do managed things internally.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists