From owner-cvs-all@FreeBSD.ORG Thu Apr 29 00:58:10 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 27C5416A4CE; Thu, 29 Apr 2004 00:58:10 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAA6543D2D; Thu, 29 Apr 2004 00:58:09 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9p2/8.12.9) with ESMTP id i3T7w07E066491; Thu, 29 Apr 2004 00:58:04 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200404290758.i3T7w07E066491@gw.catspoiler.org> Date: Thu, 29 Apr 2004 00:58:00 -0700 (PDT) From: Don Lewis To: green@FreeBSD.org In-Reply-To: <200404290251.i3T2pxBB032840@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/sound/pcm buffer.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2004 07:58:10 -0000 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.