diff options
author | Miles Bader <miles@gnu.org> | 1995-07-22 22:55:20 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1995-07-22 22:55:20 +0000 |
commit | 17346364171a6017001fbea93e8cac2b92346c7e (patch) | |
tree | 9e8dac19340d117f3868b5ceee3bd51a5c65d98d | |
parent | 1802cf4da4bb3d0509235cec185f93fdb5a4eba0 (diff) |
(dev_get_memory_object): A new pager now comes with 1 ref, so we allocate a
ref ourselves when we're using an old one, and once we've created the send
right, remove a reference.
-rw-r--r-- | devio/devpager.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/devio/devpager.c b/devio/devpager.c index 9d6e4abb..02fd54ed 100644 --- a/devio/devpager.c +++ b/devio/devpager.c @@ -258,12 +258,16 @@ dev_get_memory_object(struct dev *dev, memory_object_t *memobj) dev->pager = pager_create((struct user_pager_info *)dev, dev->pager_port_bucket, 1, MEMORY_OBJECT_COPY_DELAY); + else + ports_port_ref (dev->pager); io_state_unlock(&dev->io_state); if (dev->pager == NULL) return ENODEV; /* XXX ??? */ *memobj = pager_get_port(dev->pager); + ports_port_deref (dev->pager); /* Drop our original ref on PAGER. */ + if (*memobj != MACH_PORT_NULL) return mach_port_insert_right(mach_task_self(), |