kernel - Fix missing token release on I/O error during exec
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 8 Dec 2011 05:36:57 +0000 (21:36 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 8 Dec 2011 05:36:57 +0000 (21:36 -0800)
* If an EIO occurs while exec is mapping pages from the binary we need
  to drop the vm_object we are holding before returning.

* Fixes panic when the system runs out of memory and no swap is present.

sys/kern/kern_exec.c

index 26d4102..7339e0d 100644 (file)
@@ -666,6 +666,7 @@ exec_map_page(struct image_params *imgp, vm_pindex_t pageno,
                                vm_page_protect(m, VM_PROT_NONE);
                                vnode_pager_freepage(m);
                        }
+                       vm_object_drop(object);
                        return EIO;
                }
        }