Page MenuHomeFreeBSD

D44865.diff
No OneTemporary

D44865.diff

diff --git a/sys/compat/linuxkpi/common/src/linux_idr.c b/sys/compat/linuxkpi/common/src/linux_idr.c
--- a/sys/compat/linuxkpi/common/src/linux_idr.c
+++ b/sys/compat/linuxkpi/common/src/linux_idr.c
@@ -178,6 +178,14 @@
{
struct idr_layer *il, *iln;
+ /*
+ * This idr can be reused, and this function might be called multiple times
+ * without a idr_init(). Check if this is the case. If we do not do this
+ * then the mutex will panic while asserting that it is valid.
+ */
+ if (mtx_initialized(&idr->lock) == 0)
+ return;
+
idr_remove_all(idr);
mtx_lock(&idr->lock);
for (il = idr->free; il != NULL; il = iln) {
@@ -802,4 +810,5 @@
{
idr_destroy(&ida->idr);
free(ida->free_bitmap, M_IDR);
+ ida->free_bitmap = NULL;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 15, 2:51 PM (7 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29720203
Default Alt Text
D44865.diff (745 B)

Event Timeline