[alsa-devel] [ASoC] bug in soc_pcm_open

Liam Girdwood lg at opensource.wolfsonmicro.com
Tue Jun 12 18:29:38 CEST 2007


On Tue, 2007-06-12 at 11:21 +0530, Nobin Mathew wrote:
> Same will cause problems in ALSA also, because nobody is checking
> whether channel_min/max is zero; it is used in pcm_native.c
> 
> http://mailman.alsa-project.org/pipermail/alsa-devel/2007-June/001400.html
> 
> 
> On 6/12/07, Nobin Mathew <nobin.mathew at gmail.com> wrote:
> > Seems like a problem,
> > Adding to that
> >
> > if (machine->ops && machine->ops->shutdown)
> >                 machine->ops->shutdown(substream);
> >
> > if (platform->pcm_ops->close)
> >                 platform->pcm_ops->close(substream);
> >
> > if (cpu_dai->ops.shutdown)
> >                 cpu_dai->ops.shutdown(substream);
> >
> > if it is a error condition then above functions are called twice (also
> > in snd_codec_close())
 
They should only be called once (in open()) as close() should only be
called after the device has successfully opened.

Fwiw, I placed some debug in close just to make sure nothing in the
upper layers was calling close when open failed. Everything seems to
work as expected.

Liam



More information about the Alsa-devel mailing list