summaryrefslogtreecommitdiff
path: root/libdiskfs/file-getcontrol.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-07-21 20:53:26 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-07-21 20:53:26 +0000
commit7fd5a35d8dac0d535eab1e7b01c88b03b8a542b2 (patch)
tree6c0b95f4159a1a748a849826a2c3e788902bd27a /libdiskfs/file-getcontrol.c
parent3800229e657f9928bd5c4505c9eecb2dd1d233e9 (diff)
(diskfs_S_file_getcontrol): Free initial reference created by
ports_allocate_port.
Diffstat (limited to 'libdiskfs/file-getcontrol.c')
-rw-r--r--libdiskfs/file-getcontrol.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libdiskfs/file-getcontrol.c b/libdiskfs/file-getcontrol.c
index d4580e6c..d7c2676c 100644
--- a/libdiskfs/file-getcontrol.c
+++ b/libdiskfs/file-getcontrol.c
@@ -25,7 +25,8 @@ diskfs_S_file_getcontrol (struct protid *cred,
mach_msg_type_name_t *controltype)
{
int error = 0;;
-
+ struct port_info *newpi;
+
if (!cred)
return EOPNOTSUPP;
@@ -36,11 +37,12 @@ diskfs_S_file_getcontrol (struct protid *cred,
spin_lock (&_diskfs_control_lock);
_diskfs_ncontrol_ports++;
spin_unlock (&_diskfs_control_lock);
- *control = ports_get_right (ports_allocate_port
- (diskfs_port_bucket,
- sizeof (struct port_info),
- diskfs_control_class));
+ newpi = ports_allocate_port (diskfs_port_bucket,
+ sizeof (struct port_info),
+ diskfs_control_class);
+ *control = ports_get_right (newpi);
*controltype = MACH_MSG_TYPE_MAKE_SEND;
+ ports_port_deref (newpi);
}
return error;