Avoid lock order reversal filedesc/Giant when calling FREE() in fdalloc

by unlocking the filedesc before calling FREE().

Submitted by: bde
This commit is contained in:
Alfred Perlstein 2002-02-01 19:19:54 +00:00
parent fcce64f0cf
commit 2b39743941

View File

@ -956,9 +956,11 @@ fdalloc(td, want, result)
fdp->fd_nfiles = nfiles;
fdexpand++;
if (oldofile != NULL) {
FILEDESC_UNLOCK(fdp);
mtx_lock(&Giant);
FREE(oldofile, M_FILEDESC);
mtx_unlock(&Giant);
FILEDESC_LOCK(fdp);
}
}
return (0);