PERFORCE change 141676 for review
Christian S.J. Peron
csjp at FreeBSD.org
Fri May 16 14:34:10 UTC 2008
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.
More information about the p4-projects
mailing list