[alsa-devel] [PATCH] ASoC don't clobber platform DMA driver ops

Mark Brown broonie at opensource.wolfsonmicro.com
Thu Nov 10 12:43:10 CET 2011

On Tue, Nov 01, 2011 at 04:05:16PM -0500, Alan Tull wrote:

This looks mostly good, though as someone pointed out earlier it'd be
nicer to split the ioctl() operation addition out into a separate patch.
One issue, though.

> @@ -1547,6 +1547,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card)
>  	snd_soc_dapm_free(&card->dapm);
> +	kfree(card->rtd->ops);

This is going to leak - rtd is an array per PCM, not a single value, so
we need to free the ops for each element.  This is so we can have
multiple DMA controllers in a single card.

Actually what would be even easier would be to just embed the ops in the
struct, we need to allocate one per runtime anyway and it makes for less
allocation and cleanup code.

More information about the Alsa-devel mailing list