mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 18:50:31 -04:00
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:
parent
fcce64f0cf
commit
2b39743941
1 changed files with 2 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue