kernel - Fix panic when unloading a module on x86-64
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 20 Apr 2011 05:57:02 +0000 (22:57 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 20 Apr 2011 05:57:02 +0000 (22:57 -0700)
* Fix a vm_object ref count panic during a module unload,
  including unloads which occur after failed loads.

sys/kern/link_elf_obj.c

index 2eaf21a..51c867d 100644 (file)
@@ -660,6 +660,7 @@ link_elf_obj_load_file(const char *filename, linker_file_t * result)
                error = ENOMEM;
                goto out;
        }
+       vm_object_reference(ef->object);
        ef->address = (caddr_t) vm_map_min(&kernel_map);
        ef->bytes = 0;