Page MenuHomeFreeBSD

D62135.1795874139.diff
No OneTemporary

Authored By
Unknown
Size
770 B
Referenced Files
None
Subscribers
None

D62135.1795874139.diff

diff --git a/sys/compat/linuxkpi/common/src/linux_compat.c b/sys/compat/linuxkpi/common/src/linux_compat.c
--- a/sys/compat/linuxkpi/common/src/linux_compat.c
+++ b/sys/compat/linuxkpi/common/src/linux_compat.c
@@ -1431,6 +1431,15 @@
rw_wunlock(&linux_vma_lock);
if (error != 0) {
+ /*
+ * The mmap method of the driver has already taken a
+ * reference for this mapping (dropped by the close
+ * method of its vm_ops). The vm_area_struct is
+ * discarded here, so close it first: otherwise every
+ * second mapping of the same object leaks that
+ * reference (and the object with it).
+ */
+ vmap->vm_ops->close(vmap);
/* free allocated VM area struct */
linux_cdev_handle_free(vmap);
/* check for stale VM area struct */

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 28, 1:55 PM (13 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42065548
Default Alt Text
D62135.1795874139.diff (770 B)

Event Timeline