summaryrefslogtreecommitdiff
path: root/devio/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'devio/dev.c')
-rw-r--r--devio/dev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/devio/dev.c b/devio/dev.c
index b120c07c..f2183f3b 100644
--- a/devio/dev.c
+++ b/devio/dev.c
@@ -56,9 +56,15 @@ dev_open(char *name, int flags, int block_size, struct dev **dev)
if (*dev == NULL)
return ENOMEM;
+ (*dev)->name = malloc (strlen (name) + 1);
+ if ((*dev)->name)
+ strcpy ((*dev)->name, name);
+ else
+ err = ENOMEM;
+
(*dev)->port = MACH_PORT_NULL;
- if (device_master == MACH_PORT_NULL)
+ if (!err && device_master == MACH_PORT_NULL)
err = get_privileged_ports(NULL, &device_master);
#ifdef FAKE