From owner-p4-projects@FreeBSD.ORG Fri May 16 16:46:21 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D137A1065670; Fri, 16 May 2008 16:46:20 +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 92847106566B; Fri, 16 May 2008 16:46:20 +0000 (UTC) (envelope-from snagg@FreeBSD.org) Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) by mx1.freebsd.org (Postfix) with ESMTP id 587658FC12; Fri, 16 May 2008 16:46:20 +0000 (UTC) (envelope-from snagg@FreeBSD.org) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: snagg@autistici.org) with ESMTP id 0B6F898096 Message-Id: From: Vincenzo Iozzo To: Christian S.J. Peron In-Reply-To: <20080516141829.GA30393@sub.vaned.net> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Fri, 16 May 2008 18:22:20 +0200 References: <200805152145.m4FLjW3L015582@repoman.freebsd.org> <20080516141829.GA30393@sub.vaned.net> X-Mailer: Apple Mail (2.919.2) 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 16:46:21 -0000 You're right Christian, thanks for the review Il giorno 16/mag/08, alle ore 16:18, Christian S.J. Peron ha scritto: > 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.