Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 May 2008 18:22:20 +0200
From:      Vincenzo Iozzo <snagg@FreeBSD.org>
To:        Christian S.J. Peron <csjp@FreeBSD.org>
Cc:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   Re: PERFORCE change 141676 for review
Message-ID:  <D8207D6B-6C53-49AE-BB29-F23EECC1DA69@FreeBSD.org>
In-Reply-To: <20080516141829.GA30393@sub.vaned.net>
References:  <200805152145.m4FLjW3L015582@repoman.freebsd.org> <20080516141829.GA30393@sub.vaned.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D8207D6B-6C53-49AE-BB29-F23EECC1DA69>