From 74f44e9118c6128d583e17eb9c7f6c28741e03b6 Mon Sep 17 00:00:00 2001 From: alfred Date: Fri, 1 Feb 2002 19:19:54 +0000 Subject: Avoid lock order reversal filedesc/Giant when calling FREE() in fdalloc by unlocking the filedesc before calling FREE(). Submitted by: bde --- sys/kern/kern_descrip.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys') 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); -- cgit v1.1