From owner-p4-projects@FreeBSD.ORG Fri May 16 14:34:10 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id F034D1065674; Fri, 16 May 2008 14:34:09 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0D06106564A; Fri, 16 May 2008 14:34:09 +0000 (UTC) (envelope-from csjp@sub.vaned.net) Received: from sub.vaned.net (sub.vaned.net [205.200.235.40]) by mx1.freebsd.org (Postfix) with ESMTP id 82B818FC13; Fri, 16 May 2008 14:34:09 +0000 (UTC) (envelope-from csjp@sub.vaned.net) Received: by sub.vaned.net (Postfix, from userid 1001) id 129DA33A; Fri, 16 May 2008 09:18:29 -0500 (CDT) Date: Fri, 16 May 2008 09:18:29 -0500 From: "Christian S.J. Peron" To: Vincenzo Iozzo Message-ID: <20080516141829.GA30393@sub.vaned.net> References: <200805152145.m4FLjW3L015582@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200805152145.m4FLjW3L015582@repoman.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: Perforce Change Reviews Subject: Re: PERFORCE change 141676 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2008 14:34:10 -0000 On Thu, May 15, 2008 at 09:45:32PM +0000, Vincenzo Iozzo wrote: [..] > ==== //depot/projects/soc2008/snagg-audit/sys/security/audit/audit_pipe.c#9 (text) ==== > > @@ -435,10 +435,6 @@ > if (app != NULL) { > TAILQ_REMOVE(&ap->ap_preselect_list, app, app_list); > mtx_unlock(&audit_pipe_mtx); > - } > - > - mtx_unlock(&audit_pipe_mtx); > - if (app != NULL) { > for(i = 0; i < app->app_event_len; i++) Now we have eliminated the unlock which means we are leaking a mutex. Why not try something like: [..] if (app != NULL) TAILQ_REMOVE(&ap->ap_preselect_list, app, app_list); mtx_unlock(&audit_pipe_mtx); This way we dont need to worry about conditionally dropping the mutex.