summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2002-02-01 19:19:54 +0000
committeralfred <alfred@FreeBSD.org>2002-02-01 19:19:54 +0000
commit74f44e9118c6128d583e17eb9c7f6c28741e03b6 (patch)
tree635009af09bc818e07f437d6a56351ec5feeefdc /sys
parent71e646a649dd50023e82b1da036ba3d3864f6cba (diff)
downloadFreeBSD-src-74f44e9118c6128d583e17eb9c7f6c28741e03b6.zip
FreeBSD-src-74f44e9118c6128d583e17eb9c7f6c28741e03b6.tar.gz
Avoid lock order reversal filedesc/Giant when calling FREE() in fdalloc
by unlocking the filedesc before calling FREE(). Submitted by: bde
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_descrip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 531b67f..7628d5a 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -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);
OpenPOWER on IntegriCloud