cvs commit: src/sys/dev/sound/pcm buffer.c

Don Lewis truckman at
Thu Apr 29 00:58:10 PDT 2004

On 28 Apr, Brian Feldman wrote:
> green       2004/04/28 19:51:59 PDT
>   FreeBSD src repository
>   Modified files:
>     sys/dev/sound/pcm    buffer.c 
>   Log:
>   Don't do malloc(M_WAITOK) for sound buffers while locks are held.
>   Revision  Changes    Path
>   1.23      +1 -1      src/sys/dev/sound/pcm/buffer.c

The correct fix is to not hold the offending lock across the
sndbuf_create() call and nuke the (tmpbuf == NULL) test.  At present, if
the malloc() call fails, the channel will not be relocked, and my panic
the system with an MTX_ASSERT() failure.  I wouldn't bet that the ENOMEM
failure is properly handled.

I pretty much know how I want to fix the locking, but haven't had time
to do it.  There are a bunch of other places in the sound code with
similar problems.

More information about the cvs-src mailing list