Re: [RFC 0/2] McBSP and ASoC OMAP update patches for 2430 and 34xx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 26, 2008 at 12:35:13AM +0300, Felipe Balbi wrote:
> On Mon, Aug 25, 2008 at 12:19:16PM -0700, Steve Sakoman wrote:
> > ALSA sound/core/pcm_native.c:2573: BUG? (substream != ((void *)0))
> 
> Hmmm... this looks odd.
> 
> Jarkko, shouldn't that snd_assert() in pcm_native.c check if substream
> _is_ NULL instead of !is NULL ?
> 
> I mean:
> 
> diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> index c49b9d9..db86090 100644
> --- a/sound/core/pcm_native.c
> +++ b/sound/core/pcm_native.c
> @@ -2570,7 +2570,7 @@ static int snd_pcm_playback_ioctl1(struct file *file,
>                                    struct snd_pcm_substream *substream,
>                                    unsigned int cmd, void __user *arg)
>  {
> -       snd_assert(substream != NULL, return -ENXIO);
> +       snd_assert(substream == NULL, return -ENXIO);
>         snd_assert(substream->stream == SNDRV_PCM_STREAM_PLAYBACK, return -EINVAL);
>         switch (cmd) {
>         case SNDRV_PCM_IOCTL_WRITEI_FRAMES:
> 
> If you follow up the function calls, we can see that substream is
> initialized in pcm_native.c:snd_pcm_open_file():
> 
> 2080         err = snd_pcm_open_substream(pcm, stream, file, &substream);
> 2081         if (err < 0)
> 2082                 return err;
> 
> and that initialized pointer is added to pcm_file in the same function
> a few lines later:
> 
> 2089         pcm_file->substream = substream;
> 
> Am I misreading something ? :-s

btw, the for loop in pcm.c:snd_pcm_attach_substream looks weird.
Couldn't it be changed to use list_for_each_entry() or any of its friends ?

 797                         for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream; substream; substream = substr     eam->next) {

-- 
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux